C# – Deserialization error in a new environment

csoapweb servicesxml

I have a web application that calls a third-party web service. When I run it locally, I have no problems, but when I move it to my production environment, I get the following error:

There is an error in XML document (2, 428).
Stack:
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle) 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) at RMXClasses.RMXContactService.ContactService.getActiveSessions(String user, String pass) in C:\Users\hp\Documents\Visual Studio 2008\Projects\ReklamStore\RMXClasses\Web References\RMXContactService\Reference.cs:line 257 at

I have used the same web config file from the production environment but it still works locally. My local machine is a running vista home edition and the production environment is windows server 2003. The application is written in asp.net 3.5, wierdly under the asp.net config tab in iis, 3.5 doesn't show up in the drop down list, although that version of the framework is installed. The error is not being thrown in my code, it happens during serialization. I called the method on the proxy, I have checked the arguments and they are OK. I have also logged the SOAP request and response, and they both look OK as well. I am really at a loss here. Any ideas?

SOAP log: This is the soap response that the program seems to have trouble parsing only on server 2003. On my machine the soap is identical, and yet it parses with no problems.

SoapResponse BeforeDeserialize;
<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:ContactService" xmlns:ns2="http://api.yieldmanager.com/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:getActiveSessionsResponse>
<sessions SOAP-ENC:arrayType="ns2:session[1]" xsi:type="ns2:array_of_session">
<item xsi:type="ns2:session">
<token xsi:type="xsd:string">xxxxxxxxxxxxxxxxxxxx1ae12517584b</token>
<creation_time xsi:type="xsd:dateTime">2009-09-25T05:51:19Z</creation_time>
<modification_time xsi:type="xsd:dateTime">2009-09-25T05:51:19Z</modification_time>
<ip_address xsi:type="xsd:string">xxxxxxxxxx</ip_address>
<contact_id xsi:type="xsd:long">xxxxxx</contact_id></item></sessions>
</ns1:getActiveSessionsResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

Best Answer

Have you tried running Aspnet_regiis.exe ?

When multiple versions of the .NET Framework are executing side-by-side on a single computer, the ASP.NET ISAPI version mapped to an ASP.NET application determines which version of the common language runtime (CLR) is used for the application. The ASP.NET IIS Registration Tool (Aspnet_regiis.exe) allows an administrator or installation program to easily update the script maps for an ASP.NET application to point to the ASP.NET ISAPI version that is associated with the tool. The tool can also be used to display the status of all installed versions of ASP. NET, register the ASP.NET version that is coupled with the tool, create client-script directories, and perform other configuration operations.

Related Topic