I am getting differing behavior between serialization and deserialization with axis.
Here is the scenario,
I am using the following structure to represent an ArrayOfBoolean values. Please notice the nillable="true", so the
elements can be null.
<xsd:complexType name="ArrayOfBoolean">
<xsd:complexContent>
<xsd:sequence>
<xsd:element
name="a"
type="xsd:boolean"
minOccurs="0"
maxOccurs="unbounded"
nillable="true"
/>
</xsd:sequence>
</xsd:complexContent>
</xsd:complexType>
Now here is the SOAP data that gets gets serialized for a{null,true,null,true}.
<a xsi:nil="true"/>
<a>true</a>
<a xsi:nil="true"/>
<a>true</a>
elements can be null.
<xsd:complexType name="ArrayOfBoolean">
<xsd:complexContent>
<xsd:sequence>
<xsd:element
name="a"
type="xsd:boolean"
minOccurs="0"
maxOccurs="unbounded"
nillable="true"
/>
</xsd:sequence>
</xsd:complexContent>
</xsd:complexType>
Now here is the SOAP data that gets gets serialized for a{null,true,null,true}.
<a xsi:nil="true"/>
<a>true</a>
<a xsi:nil="true"/>
<a>true</a>
This is done by the Axis BeanSerializer.
I am serializing / deserializing this to a boolean array using axis.
During deserialization, I am thinking I should get back a boolean array of size 4, with elements 0 and 2 null and 1 and
4 false.
I am serializing / deserializing this to a boolean array using axis.
During deserialization, I am thinking I should get back a boolean array of size 4, with elements 0 and 2 null and 1 and
4 false.
Now because of this fastpath nil check returning null in BeanDeserializer, my indexing gets lost.
// Fastpath nil checks...
if (context.isNil(attributes))
return null;
if (context.isNil(attributes))
return null;
I get an array of size 2 with both elements true.
I think this should not be the case. I feel if serialization writes out xsi:nil="true" for a null element,
deserialization should also set back the value as null, so as to maintain indexing.
I think this should not be the case. I feel if serialization writes out xsi:nil="true" for a null element,
deserialization should also set back the value as null, so as to maintain indexing.
I looked at Axis 1.2, same code. I am getting the latest build to see if anything has changed.
Your views on this is greatly appreciated.
If anyone feels this is appropriate for the axis-dev list, do let me know too.
Regards
Vijay
Vijay
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
