Hi,
We call a web service that generates the below class structure in its proxy.
We have been getting a NullReferenceException whenever the returned value
contained the KeyRecOrderVO object. Later we found that it was because of the
variable "type" in KeyRecOrderVO object. We commented this variable (or
change its name) and it worked fine.
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.SoapTypeAttribute(Namespace =
"http://services.abc.efg.rt.fi.xxxxx.com/")]
public partial class KeyRecOrderVO
{
/// <remarks/>
public int shippedPackQuantity;
/// <remarks/>
public int type;
/// <remarks/>
[System.Xml.Serialization.SoapElementAttribute(IsNullable = true)]
public string commentText;
}
We have noticed that .Net CF 2.0 has added support for SOAP1.2,
System.Xml.Schema namespace etc (based on article
http://www.ftponline.com/reports/tech-ed/2004/yuan/). The Soap message
contains â??typeâ?? as an attribute to describe the datatype of the variable
being deseriabled, hence I guess it could be treating the word type as schema
keyword and failing to deserialize further. However, it works fine in .NET CF
1.0 and and in full framework.
snippet of SOAP message:
<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
----
---
<return xmlns:ns2="http://order.bl.rv.im.sa.homedepot.com/"
xsi:type="ns2:KeyrecOrderVO">
<shippedPackQuantity xsi:type="xsd:int">1</shippedPackQuantity>
<type xsi:type="xsd:int">1</type>
<commentText xsi:type="xsd:string" xsi:null="true" />
Can some please let us know if there is a workaround for fixing this issue
by
permitting the usage of the word â??typeâ?? as the proxy class member variable
and also if there are any such breaking changes between .NET CF 1.0 SP3 and
.NET CF 2.0 SP2.
Thanks,