|
Here is another thing I've got in my NULL interop
testing between Axis and .Net
Here is a type defined like this:
<complexType
name="ComplexType">
<sequence> <element name="int0" nillable="true" minOccurs="0" type="xsd:int"/> <element name="int1" nillable="false" minOccurs="0" type="xsd:int"/> <element name="int2" nillable="true" minOccurs="1" type="xsd:int"/> <element name="int3" nillable="false" minOccurs="1" type="xsd:int"/>
<element name="str0" nillable="true" minOccurs="0"
type="xsd:string"/>
<element name="str1" nillable="false" minOccurs="0" type="xsd:string"/> <element name="str2" nillable="true" minOccurs="1" type="xsd:string"/> <element name="str3" nillable="false" minOccurs="1" type="xsd:string"/> </sequence> </complexType> On the server side, the ComplexType object is constructed like
this:
public ComplexType()
{
int0 = null; int1 = new Integer(1); int2 = null; int3 = new Integer(3); str0 =
null;
str1 = null; // this violates nillable="false" str2 = null; str3 = new String("three"); } In this case, the value to be transmitted is null and one
would expect nothing to be sent over the wire (i.e. no value and no XML tags for
the "value"), but instead xsi:nil="true" is being sent:
<soapenv:Body>
<complexTypeOutResponse xmlns="http://test.enterprise.ent"> <complexTypeOutReturn> <int0 xsi:nil="true"/> <int1>1</int1> <int2 xsi:nil="true"/> <int3>3</int3> <str0 xsi:nil="true"/> <str1 xsi:nil="true"/> <str2 xsi:nil="true"/> <str3>three</str3> </complexTypeOutReturn> </complexTypeOutResponse> </soapenv:Body> Is it a bug?
Thanks,
Eugene
|
- RE: Returning nulls with minOccurs set to 0 Eugene Shershnev
- RE: Returning nulls with minOccurs set to 0 Simon Fell
- Re: Returning nulls with minOccurs set to 0 Eugene Shershnev
- Re: Returning nulls with minOccurs set to 0 Eugene Shershnev
