469,609 Members | 1,687 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

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 5240

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by John Rebbeck | last post: by
6 posts views Thread by darrel | last post: by
7 posts views Thread by benoit | last post: by
14 posts views Thread by Lorenzo | last post: by
5 posts views Thread by MichiMichi | last post: by
4 posts views Thread by vunet.us | last post: by
3 posts views Thread by rn5a | last post: by
6 posts views Thread by withers | last post: by
3 posts views Thread by =?Utf-8?B?YzY3NjIyOA==?= | last post: by
reply views Thread by Solution2021 | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.