Click here to Skip to main content
15,902,299 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have this Error in connection between a windows application and web service:
(in some pc a haven't any problem)
System.InvalidOperationException: Response is not well-formed XML. ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 2.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlReader.MoveToContent()
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
--- End of inner exception stack trace ---
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
Posted

1 solution

Chances are what you are getting back isn't XML at all. I suggest you install Fiddler[^] to find out what the server is sending back.
 
Share this answer
 
Comments
Dholakiya Ankit 7-Aug-13 3:23am    
5ed
abtinC# 2009 7-Aug-13 5:44am    
Thanks Dennis C.Dietrich
I download fiddler and run in client pc ,error is :
Context-Length mismatch : response Header indicated 294 byte,but server sent 344
Bernhard Hiller 7-Aug-13 6:35am    
Even that should not cause that error. Look at the contents: do they start like correct XML, i.e. with a "<?xml"
abtinC# 2009 11-Aug-13 3:36am    
this is true .my returned file from web service have this code befor "xml header ":

" 11 Aug 2013 07:19:07 GMTContent-Length: 430"please help me

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900