I am using C# .Net 2.0 to write a webservices client. The server’s soap implementation is tested and is pretty solid. gSoap/C++ applications had no problem reading the responses. However the .Net implementation complains ‘There is an error in XML document’ while calling one of the methods. Similar responses recieved from the server were happily processed by the xml parser.
Looks like to me the MSXML parser (I hope thats the one .Net is been using) is a very unforgiving parser.
I have no control over the server. Some how I have to work around this problem. So, I was thinking of writing a SoapExtension as describe here
So my question is, can I hook a parser before Deserialize stage and completely bypass the Deserialize stage.
And above all, how do i instruct the SOAP stub to use my extended class ?
First of all I’d grab a snapshot of the failing XML in the Deserialise stage to try and diagnose the problem.
You can hook your soap extension into your client app without recompiling. Just add:
DebugTools.SOAP.SOAPTrace is the namespace of the SoapTraceExtension
DebugTools.SOAP is the name of the assembly containing the soap trace code.
to your app.config or web.config file.
It would be handy if you could paste in the complete exception with stack trace. There may be something really obvious. Also, if possible the WSDL for the web service, that would be very useful.