473,413 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Server MapPath

Hello folks. How do I solve the problem below?

when my program executes the line below :

Package.WriteXml(Server.MapPath(strID[1] + ".XML"));

Ireceive the following error message:

System.Web.Services.Protocols.SoapException: Server was unable to process
request. ---> System.UnauthorizedAccessException: Access to the path
"c:\inetpub\wwwroot\postingcenter\SGOC4.XML" is denied. at
System.IO.__Error.WinIOError(Int32 errorCode, String str) at
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean
bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode,
FileAccess access, FileShare share) at System.Xml.XmlTextWriter..ctor(String
filename, Encoding encoding) at System.Data.DataSet.WriteXml(String
fileName, XmlWriteMode mode) at System.Data.DataSet.WriteXml(String
fileName) at PostingCenter.pc0001.PostMessageToEMS(DataSet Package, String
sFromModule, String sToModule) in
c:\inetpub\wwwroot\postingcenter\pc0001.asmx.cs:li ne 149 at
PostingCenter.pc0001.DispatchMessage(DataSet Package, String sFromModule,
String sToModule) in c:\inetpub\wwwroot\postingcenter\pc0001.asmx.cs:li ne
168 at PostingCenter.pc0001.sendPackage(DataSet Package, String sFromModule,
String[] sToModule) in c:\inetpub\wwwroot\postingcenter\pc0001.asmx.cs:li ne
108 --- End of inner exception stack trace ---
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.Services.Protocols.SoapException:
System.Web.Services.Protocols.SoapException: Server was unable to process
request. ---> System.UnauthorizedAccessException: Access to the path
"c:\inetpub\wwwroot\postingcenter\SGOC4.XML" is denied. at
System.IO.__Error.WinIOError(Int32 errorCode, String str) at
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean
bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode,
FileAccess access, FileShare share) at System.Xml.XmlTextWriter..ctor(String
filename, Encoding encoding) at System.Data.DataSet.WriteXml(String
fileName, XmlWriteMode mode) at System.Data.DataSet.WriteXml(String
fileName) at PostingCenter.pc0001.PostMessageToEMS(DataSet Package, String
sFromModule, String sToModule) in
c:\inetpub\wwwroot\postingcenter\pc0001.asmx.cs:li ne 149 at
PostingCenter.pc0001.DispatchMessage(DataSet Package, String sFromModule,
String sToModule) in c:\inetpub\wwwroot\postingcenter\pc0001.asmx.cs:li ne
168 at PostingCenter.pc0001.sendPackage(DataSet Package, String sFromModule,
String[] sToModule) in c:\inetpub\wwwroot\postingcenter\pc0001.asmx.cs:li ne
108 --- End of inner exception stack trace ---

Source Error:

Line 35:
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("http://tempuri.o
rg/sendPackage", RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
Line 36: public int sendPackage(System.Data.DataSet Package, string
sFromModule, string[] sToModule) {
Line 37: object[] results = this.Invoke("sendPackage", new
object[] {
Line 38: Package,
Line 39: sFromModule,
Source File: c:\inetpub\wwwroot\sgocnet\Web
References\localhost1\Reference.cs Line: 37

Stack Trace:

[SoapException: System.Web.Services.Protocols.SoapException: Server was
unable to process request. ---> System.UnauthorizedAccessException: Access
to the path "c:\inetpub\wwwroot\postingcenter\SGOC4.XML" is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath,
Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share)
at System.Xml.XmlTextWriter..ctor(String filename, Encoding encoding)
at System.Data.DataSet.WriteXml(String fileName, XmlWriteMode mode)
at System.Data.DataSet.WriteXml(String fileName)
at PostingCenter.pc0001.PostMessageToEMS(DataSet Package, String
sFromModule, String sToModule) in
c:\inetpub\wwwroot\postingcenter\pc0001.asmx.cs:li ne 149
at PostingCenter.pc0001.DispatchMessage(DataSet Package, String
sFromModule, String sToModule) in
c:\inetpub\wwwroot\postingcenter\pc0001.asmx.cs:li ne 168
at PostingCenter.pc0001.sendPackage(DataSet Package, String sFromModule,
String[] sToModule) in c:\inetpub\wwwroot\postingcenter\pc0001.asmx.cs:li ne
108
--- End of inner exception stack trace ---]

System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClient
Message message, WebResponse response, Stream responseStream)
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
sgocnet.localhost1.pc0001.sendPackage(DataSet Package, String
sFromModule, String[] sToModule) in c:\inetpub\wwwroot\sgocnet\Web
References\localhost1\Reference.cs:37
sgocnet.comOfficer.PostMessage(DataSet Package, String sFromModule,
String[] sToModule) in c:\inetpub\wwwroot\sgocnet\comofficer.cs:32
sgocnet.comOfficer.PreparePackage(DataSet Package, String sFromModule,
String[] sToModule) in c:\inetpub\wwwroot\sgocnet\comofficer.cs:24
sgocnet.co0005.SendMessageForOfficer() in
c:\inetpub\wwwroot\sgocnet\co0005.aspx.cs:294
sgocnet.co0005.btIncluir_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\sgocnet\co0005.aspx.cs:470
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo
stBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
System.Web.UI.Page.ProcessRequestMain() +1263



Nov 17 '05 #1
0 5456

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: John Rebbeck | last post by:
I've got the directory f:\Company\Product set as web shared so it's got a virtual directory in the default web site on my test server's IIS. If I try to use Server.MapPath in that site it returns a...
4
by: Laphan | last post by:
Hi All Sorry to be irate, but the whole concept of Server.MapPaths really has me in a tiswas!! In order to confirm once and for all, could you please advise me on the following: 1) There...
6
by: darrel | last post by:
I have some functions that are reading/writing to the file system. As such, they use server.mapPath a lot to navigate it all. Since I'm using these functions numerous times throughout my...
7
by: benoit | last post by:
Hi, if I write this code to retrieve a folder on the server Server.mappath("/DATA") I get this error message System.InvalidOperationException: Failed to map the path '/DATA' the virtual...
14
by: Lorenzo | last post by:
Hello, I have a web application with a virtual directory in it. With 'virtual directory' i mean a folder whose physical path is different from the physical path of the application, but in which...
5
by: MichiMichi | last post by:
When using Server.MapPath on IIS 5 on my localhost everything works well. All of the following commands are executed without any error Response.Write(Server.MapPath("/app_test") & "<br>")...
4
by: vunet.us | last post by:
How to use server.mappath() parent folder correctly: Server.MapPath("../test.asp") Thank you for the hint.
3
by: rn5a | last post by:
Server.MapPath returns the physical file path that corresponds to the specified virtual path whereas Request.MapPath maps the specified virtual path to a physical path. Assuming that a file named...
6
by: withers | last post by:
If I run Server.MapPath("/") on my operational Internet server I get, correctly, the physical path to the directory my page is in (d:\.... \...\htdocs). If I run Server.MapPath("/") on my...
3
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have one line code in my program, occasionaly I will receive the following error: "The Path parameter for the MapPath method did not correspond to a known path" ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.