Last post Sep 10, 2013 01:54 PM by Krish85
Sep 08, 2013 02:19 AM|Krish85|LINK
I am using a 3rd party web service. I have added a service reference to a window application project. When I call any function of the web service I get the follwoing error,
System.InvalidOperationException: Response is not well-formed XML. ---> System.Xml.XmlException: Root element is missing.\r\n at System.Xml.XmlTextReaderImpl.Throw(Exception e)\r\n at System.Xml.XmlTextReaderImpl.ParseDocumentContent()\r\n at System.Xml.XmlTextReaderImpl.Read()\r\n
at System.Xml.XmlTextReader.Read()\r\n at System.Xml.XmlReader.MoveToContent()\r\n at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)\r\n at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object parameters)
The same service can be accessed from a web browser without any error.
Can anyone please help?
Sep 08, 2013 05:02 PM|sukumarraju|LINK
Response is not well-formed XML.
Check the web service method name being consumed is correct or mis-spelled.
Copy the client source that invokes the service for further help.
Sep 10, 2013 05:58 AM|Amy Peng - MSFT|LINK
As you said that the same service can be accessed from a web browser without any error, it seems that it's a permission related issue in C:/Windows/Temp folder .
And if you still can not solve your problem, please try to download Fiddler and use this tool to check the response text.
Sep 10, 2013 01:54 PM|Krish85|LINK
Thanks all for your help. I figured it out later. The web service vendor had written a SoapExtension class where it was expecting a path in the file system that was not present. Once I created the path, it started working.