views:

55

answers:

0

I have some web services that are returning data as an ArrayList of varying data types. One of those data types is MyType, which is a serializable type defined in another dll. We've recently moved from .NET 1.1 to .NET 3.5, but can't change the API of the web services, so we need to stick to ArrayLists for now.

We have a Web Service Proxy that our client and App Server share, based on SoapHttpClientProtocol. In order to optomize the startup time of this Proxy on the client, we've recently started using sgen to generate the precompiled XmlSerializers. It shaves a lot of time off our client startup.

However MyType deserializes differently into the ArrayList from the proxy, based on whether or not the precompiled XmlSerializer is there. Without the XmlSerializer.dll, the data looks like this:

{<MyType>...</MyType>}

Which can easily be cast into MyType.

However, when I run sgen and the XmlSerializer.dll is present, the data is an XmlNode[], with one XmlNode for each of MyType's elements. This is not so easy to deal with!

Any idea why the precompiled XmlSerializers would be different then the JIT compiled ones? Any advice on how to solve this problem?