Article ID: 929545
Article Last Modified on 12/21/2006
APPLIES TO
- Microsoft .NET Framework 1.1
- Microsoft Web Services Enhancements for Microsoft .NET 1.1
SYMPTOMS
When 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:
This behavior may also occur when you use a Java-based client.
Note This behavior does not occur when you use a .NET Framework 2.0-based client.
CAUSE
This behavior occurs because the .NET Framework 1.1 does not support deserialization of nullable value types.
WORKAROUND
To 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.
public class MyClass { public int id; }
To work around this problem, replace the code for the proxy class with the following code example.
public class MyClass { [XmlElement(IsNullable = true)] public string id; [XmlIgnore] public int idValue { get { if (this.id == null || this.id.Length == 0) return 0; return Convert.ToInt32(id); } set { id = Convert.ToString(value); } } }
Keywords: kbcode kbexcepthandling kbwebclasses kb80004005 kbwebservices kbexpertiseinter kbtshoot kbprb KB929545