Using Web Services to Modify an XML File?

  • Thread starter Thread starter Greatfree
  • Start date Start date
G

Greatfree

Dear all,

I tried to modify an XML file in a Web Service. After that, I need to save
the XML file into a local disk. But I got the following errors. Could you
please tell me what's going on there?

Thanks so much in advance!
Greatfree


System.UnauthorizedAccessException: Access to the path
"D:\Space\WWWRoot\TicketforGames\ticket_game_request.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.Xml.XmlDOMTextWriter..ctor(String filename, Encoding encoding)
at System.Xml.XmlDocument.Save(String filename)
at com.lblabs.webservices.TicketforGames.generateRequestXML(String
inputAccountName, String inputAccountPassword, String
inputAccountCreditCardNumber, String ticketType, String strTicketAmount) in
d:\space\wwwroot\ticketforgames\ticketforgames.asmx.cs:line 215
at com.lblabs.webservices.TicketforGames.BuyTickets(String
inputAccountName, String inputAccountPassword, String
inputAccountCreditCardNumber, String ticketType, Int32 ticketAmount) in
d:\space\wwwroot\ticketforgames\ticketforgames.asmx.cs:line 92
 
This is privileges issue. The user which .net uses to run a web-services is
restricted. you should allow that user to write the specific file/folder.
I'd suggest to use for writing any other folder on the hdd, not something in
wwwroot.

Sunny
 
Back
Top