axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorge Fernandez <>
Subject RE: null values in attributes (hierarchies with ADB)
Date Mon, 13 Aug 2007 20:08:30 GMT
Hola Martin,

See you're back.

I meant setting the whole array to null. When setting one of the elements, there's no problem.

For example, If I have a class disc and a class discography that has an array of discs as
attribute, I can perfectly set any of the components to null.

Also if I set the array to null doing setDiscs(null), there is no problem. The element is
generated in the message. If I don't call setDiscs(), the element will be generated anyway.

But if I create a class Elvis that extends discography and I don't call setDiscs(), the element
won't be generated in the message. If instead I call setDiscs(null), the element will be generated.

It works anyway but the behaviour is different. 
 If element is generated, the client will interpret that discs has one component that is null
If element is not generated, the client will interpret that discs=null. 

I thought that the correct behaviour should be the second: as the whole array is null, it
won't generate any element in the message for that and the client will interpret that the
array is null. Or in the second case, in spite of generating the element in the message, the
client should interpret that the array is null


Jorge Fernández

Martin Gainty <> escribió: Jorge

Looking for specifics on what you mean by "setting it"
do you mean setting the array to null or one of the elements in the array?

NULL is a representation of an uninitialised object
the treatment of this uninitialised object is language dependent
that said

an Array of NULL objects is an allocated array object of uninitialised empty 

so..a java.lang.Arrays is an *allocated object*( which is represented by the 
Javadoc available here

To add more even more confusion Arrays of primitive types (ints/chars) are 
different than arrays of Objects which are pre-allocated entities

An Array of primitive types allocation is dependent on the number of 
any array of pre-defined size is allocated

In JavaScript world the treatment of Arrays is even dependent on the browser 
JavaScript version
Mozilla JavaScript1.2 converts an Array object to its length. Mozilla 
JavaScript1.1, JavaScript1.3-JavaScript1.5 converts an empty Array to 0

Martin Gainty

Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official 
business of Sender. This transmission is of a confidential nature and Sender 
does not endorse distribution to any party other than intended recipient. 
Sender does not necessarily endorse content contained within this 
(mobile) 001-603-438-5053

>From: Jorge Fernandez 
>To: axis-user 
>Subject: null values in attributes (hierarchies with ADB)
>Date: Mon, 13 Aug 2007 15:40:56 +0200 (CEST)
>MIME-Version: 1.0
>Received: from ([]) by 
> with Microsoft SMTPSVC(6.0.3790.2668); Mon, 13 
>Aug 2007 06:41:37 -0700
>Received: (qmail 48452 invoked by uid 500); 13 Aug 2007 13:41:28 -0000
>Received: (qmail 48441 invoked by uid 99); 13 Aug 2007 13:41:28 -0000
>Received: from (HELO (    
>by (qpsmtpd/0.29) with ESMTP; Mon, 13 Aug 2007 06:41:28 -0700
>Received: pass ( local policy includes SPF record at 
>Received: from [] (HELO 
>(    by (qpsmtpd/0.29) with SMTP; Mon, 13 Aug 2007 
>13:41:29 +0000
>Received: (qmail 60995 invoked by uid 60001); 13 Aug 2007 13:40:56 -0000
>Received: from [] by via HTTP; Mon, 
>13 Aug 2007 15:40:56 CEST
>X-Message-Delivery: Vj0zLjQuMDt1cz0wO2k9MDtsPTA7YT0w
>Mailing-List: contact; run by ezmlm
>Precedence: bulk
>Delivered-To: mailing list
>X-ASF-Spam-Status: No, hits=2.0 required=10.0tests=HTML_MESSAGE,SPF_PASS
>DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;  s=s1024;;  

>X-Virus-Checked: Checked by ClamAV on
>X-OriginalArrivalTime: 13 Aug 2007 13:41:37.0072 (UTC) 
>I'm observing that when I have an object  with array attributes, ADB 
>behaves different depending on whether that attribute is inherited or not.
>If I have an inherited array, and I don't call its set method, that element 
>won't appear in the SOAP message. The client will see that the array is 
>If in the same case, I set it to null, the element will appear as nil in 
>the SOAP message.  The client sees an array of one null component.
>With a non-inherited array, the element will appear as nil if I set it to 
>null and if I don't call the method too. The client sees an array of one 
>null component.
>If I have an attribute that is not an array (ex: a String). Its behaviour 
>is the same if it's inherited or not. The element will appear as nil.
>My question are:
>Why does it work different for an inherited array??
>Why my client sees the array with one null component when the array comes 
>as nil?? Shouldn't him see it as a null array??
>Why when an attribute is null it appears as nil in the soap message?? 
>Shouldn't it be better that the attribute wouldn't appear in the message?
>Jorge Fernández
>Sé un Mejor Amante del Cine
>¿Quieres saber cómo? ¡Deja que otras personas te ayuden!.

See what you’re getting into…before you go there


¡Descubre una nueva forma de obtener respuestas a tus preguntas!
Entra en Yahoo! Respuestas.

View raw message