null/true/false would be a tri-state kind of variable with a whole different algebra :-)
In particular to Java, a boolean variable can only be true or false so of course you
won't be able to deserialize a null into a boolean.
BarZ
sreekantan, vijay wrote:
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>
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.
Now because of this fastpath nil check returning null in BeanDeserializer, my indexing gets lost.
// Fastpath nil checks...
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 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
------------------------------------------------------------------------
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th <http://taxes.yahoo.com/filing.html>
Nueva forma de conectarse a internet en URUGUAY ------------- Cuanto gasta hoy ? -------------- Tel. 0909.20.30 => Acceso 100% digital 56K! Promocion lanzamiento: $0,10 mas IVA el minuto. =============================================== http://www.internet.com.uy - Internet en serio.
