468,290 Members | 1,993 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,290 developers. It's quick & easy.

Client Error When Consuming Web Method

A little background.

This is a VB.Net client application , and it uses a web reference to a web
service, which has been properly refreshed.

My app takes collections of two serializable objects, and serializes them to
a XMLDocument object. The serializer uses Chris Lovett's XMLNodeWriter.dll to
write directly to the XMLDocument.

XMLDocument.DocumentElement is passed to the Web method which takes an
XML.XMLNode parameter. (Originally the XML was passed as a string. This was
changed based upon a GotDotNet thread I read, in which Dare Obasanjo states
that using an XML.XMLNode object is recommended for passing XML to a
webservice. The XML string also produced a slightly different server parsing
error).

Intermittently, the following error is sent up the call stack when making
the call from a client's machine. We have isolated the exception to specific
object instances, and can now reproduce the following.

System.Web.Services.Protocols.SoapException: Server was unable to read
request. --> There is an error in XML document (1, 754). --> The '<'
character, hexadecimal value 0x3C, cannot be included in a name. Line 1,
position 1025.
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)

First, is this actually a server side exception, or will the proxy code
generated by the web reference throw this exception? (Confusing since the
text of the exception includes : Server was unable to read request.)

Second, after encountering this exception I save the contents of the
XMLDocument. The client sends me this XML file, and loading this file into an
XMLDocument object, I can successfully execute the web service while
stepping through the client in the VS.Net IDE. One difference is that my
client's computer does not have the Framework 1.1. SP1 applied, and I do. I
googled the fixes introduced by SP1, but saw nothing related to this problem.
Did I miss something?

Third, the serializable classes are pretty straightforward. Their are two of
them. They inherit from base classes which contain only public fields of
native(?) types (String,Integer etc.) . They also contain arraylists of other
objects(email, address etc.) which are also simple classes containing only
public fields of native types. I use the XmlInclude attribute to include
these types. Am I missing a known bug in XMLSerialization which would explain
the exception?

Fourth, as I stated, we now have it isolated to a few different specific
object instances. What is frustrating is that the serialized XML can be
successfully saved at the time of the exception. Inspecting the XML, it is
well-formed. Could the XMLDocument be doing something under the hood when
saving that corrects the problem? Again, the DocumentElement property of the
XMLDocument is passed as the argument. You would think this would be an exact
replica of what would be saved to file.

Finally, if this is truly a server side exception, I am assuming it is
occuring in the .Net runtime before ever reaching the actual web method code.
What are my options for sniffing this low level?

Any contributions would be greatly appreciated.

Matthew
Nov 23 '05 #1
0 1254

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Matthew King | last post: by
reply views Thread by Matthew Copeland | last post: by
reply views Thread by erik.erikson | last post: by
3 posts views Thread by Jeremy Chapman | last post: by
1 post views Thread by =?Utf-8?B?R29yZG9u?= | last post: by
2 posts views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.