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 discs[0]=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

Thanks,

Jorge Fernández

Martin Gainty <[EMAIL PROTECTED]> 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 
objects

so..a java.lang.Arrays is an *allocated object*( which is represented by the 
Javadoc available here
http://java.sun.com/j2se/1.5.0/docs/api/

To add more even more confusion Arrays of primitive types (ints/chars) are 
different than arrays of Objects which are pre-allocated entities
http://java.sun.com/docs/books/jni/html/objtypes.html

An Array of primitive types allocation is dependent on the number of 
elements
BUT
any array of pre-defined size is allocated
http://java.sun.com/docs/books/jni/html/objtypes.html

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

HTH/
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 
transmission.
(mobile) 001-603-438-5053





>From: Jorge Fernandez 
>Reply-To: [EMAIL PROTECTED]
>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 mail.apache.org ([140.211.11.2]) by 
>bay0-mc3-f7.bay0.hotmail.com 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 nike.apache.org (HELO nike.apache.org) (192.87.106.230)    
>by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Aug 2007 06:41:28 -0700
>Received: pass (nike.apache.org: local policy includes SPF record at 
>spf.trusted-forwarder.org)
>Received: from [217.12.10.88] (HELO web26014.mail.ukl.yahoo.com) 
>(217.12.10.88)    by apache.org (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 [84.78.70.217] by web26014.mail.ukl.yahoo.com via HTTP; Mon, 
>13 Aug 2007 15:40:56 CEST
>X-Message-Delivery: Vj0zLjQuMDt1cz0wO2k9MDtsPTA7YT0w
>X-Message-Info: 
>JGTYoYF78jFqB8E5WzR+LBEQqsj3ei+0NzvpxfbZZbvfB0Vjt9AshFgkMxyC89WmXeUfrIBu53/rR/Zl+gqTSQ==
>Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
>Precedence: bulk
>list-help: 
>list-unsubscribe: 
>List-Post: 
>List-Id: 
>Delivered-To: mailing list axis-user@ws.apache.org
>X-ASF-Spam-Status: No, hits=2.0 required=10.0tests=HTML_MESSAGE,SPF_PASS
>X-Spam-Check-By: apache.org
>DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;  s=s1024; d=yahoo.es;  
>h=X-YMail-OSG:Received:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID;
> 
>  
>b=lnJ74kNrTOROD2njDRpji0jNo8OZWrU5oCV3tSKXUZrfal8CQXF5N+gzoV1nyau8D5f9B0mnDBhDzATJdaAcYEYA9CfZVpwW98NSRVgQygXyctAO1r5iSsmGEyPR5TLY5mrVmDER4TXXKFwkYbjPfkY2xdHrNIDlilnj9LUIggE=;
>X-YMail-OSG: 
>vQKm5F4VM1knWHtvn4kWcv8_Dn.NmjPxLEPTi601c2yv_cDT5.jefOVFTR38konOQg--
>X-Virus-Checked: Checked by ClamAV on apache.org
>Return-Path: [EMAIL PROTECTED]
>X-OriginalArrivalTime: 13 Aug 2007 13:41:37.0072 (UTC) 
>FILETIME=[AB903B00:01C7DDAF]
>
>Hi,
>
>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 
>null.
>
>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?
>
>Thanks,
>
>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 
http://newlivehotmail.com/?ocid=TXT_TAGHM_migration_HM_viral_preview_0507



       
---------------------------------

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

Reply via email to