axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sreekantan, vijay" <>
Subject Re: Maintaining index for Arrays with null values
Date Fri, 16 Apr 2004 14:37:34 GMT
OK. But that was not my problem. java.lang.Boolean can be null and that is what I was deserializing
to. Sorry, my fault, I did not explicitly mention that.

My problem was with the serialization / deserialization.

So lets deal with Strings.

When axis serializes a{null,"str1",null,"str2"} to 
      <a xsi:nil="true"/>
      <a xsi:nil="true"/>
I would expect the same to be deserialized to a{null,"str1",null,"str2"} instead of a{"str1","str2"}.

Is this a valid argument.

And the reason the problem arises is because of the FastPath nil checks. I feel that if it
is an indexed property, the fastpath nil checks should not be done to maintain index.

Else there does not seem to be any use to do the indexed bean property descriptor and incrementing
the collectionIndex etc...

The BeanSerializer / BeanDeserializer should be consistent.

Your thoughts and ideas are appreciated.

If this fits in the axis-dev list, do let me know.


Barzilai Spinak <> wrote:
Where I live, a boolean value can only be true or false. It's bi-state.
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.


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.
> > name="a"
> type="xsd:boolean"
> minOccurs="0"
> maxOccurs="unbounded"
> nillable="true"
> />
> Now here is the SOAP data that gets gets serialized for 
> a{null,true,null,true}.
> true
> true
> 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
View raw message