Answered by:
SoapHttpClientProtocol ReadResponse is failing with root element missing

Question
-
User591890860 posted
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?
Sunday, September 8, 2013 2:19 AM
Answers
-
User591890860 posted
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.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, September 10, 2013 1:54 PM
All replies
-
User220959680 posted
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.
Sunday, September 8, 2013 5:02 PM -
User260886948 posted
Hi,
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.
#Fiddler:
http://www.fiddler2.com/fiddler2/ .Best Regards.
Tuesday, September 10, 2013 5:58 AM -
User591890860 posted
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.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, September 10, 2013 1:54 PM