I'm getting the following error on one of 110 machines that is using a
webservice to upload database changes to a central location:
System.Web.Services
Server was unable to read request. --> There is an error in XML document (3,
2148906). --> This is an unexpected token. The expected token is 'NAME'. Line
3, position 2148909.
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)
I'd post the XML itself, but it's around 4MB and rather large. It
references "Line 3, position 2148909", but there isn't a position 2148909 on
line 3. I've checked the XML in XMLSpy and some other tools and it seems to
be fine. The XML is a .Net dataset, so it usually deals with any odd
characters for me.
John Saunders - 22 Sep 2006 03:39 GMT
> I'm getting the following error on one of 110 machines that is using a
> webservice to upload database changes to a central location:
[quoted text clipped - 18 lines]
> be fine. The XML is a .Net dataset, so it usually deals with any odd
> characters for me.
I've seen this error when I was modifying an XMLDocument. Under some
circumstances, when I added nodes to the document, they were added, but the
document didn't update its length. This caused it to be truncated in the
middle of an element, producing this error.
I don't remember exactly how I resolved this, but maybe if you copied the
document before transmitting it, then XmlDocument would remember its length.
John