Article ID: 929545 - Last Review: December 21, 2006 - Revision: 1.2 Error message when you try to use a client application that is built on the .NET Framework 1.1 to consume a .NET Framework 2.0-based Web service: "System.InvalidOperationException"SYMPTOMSWhen you try to use a Microsoft .NET Framework 1.1-based client to consume a Microsoft .NET Framework 2.0-based Web service, you may receive an error message that resembles the following: System.InvalidOperationException: There is an error in XML document (1, 446). ---> System.FormatException: Input string was not in a correct format. at System.Number.ParseUInt32(String s, NumberStyles style, NumberFormatInfo info) at System.Xml.XmlConvert.ToUInt32(String s) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderTestWs.Read1_Object1(Boolean isNullable, Boolean checkType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderTestWs.Read6_GetMethodResponse() at Microsoft.Xml.Serialization.GeneratedAssembly. GetMethodResponseSerializer.Deserialize(XmlSerializationReader reader) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) Note This behavior does not occur when you use a .NET Framework 2.0-based client. CAUSEThis behavior occurs because the .NET Framework 1.1 does not support deserialization of nullable value types. WORKAROUNDTo work around this behavior, modify the proxy class for the client application to convert nullable value types to reference types. In the following example, the nullable int type is converted to the string type. When the string value is returned, the value is converted back to the int type. For example, the code for the proxy class for the client application may resemble the following code example.
| Article Translations
|
Back to the top
