I agree with you in principal.  The reason for the odd behavior (looking at
the class of the List elements) may  be due to historical inadequacies.  I
will change to the code once the doc literal stuff is more stable.
(Perhaps Friday).  I want to make sure that there are no dependencies on
the existing behavior.

As far as reflection on the service side, you make another good point.
Russell...please consider this while doing the service method resolution
stuff.


Rich Scheuerle
XML & Web Services Development
512-838-5115  (IBM TL 678-5115)


                                                                                       
                                            
                      Vikram Rayabhari                                                 
                                            
                      <vikram@yasutech.        To:       [EMAIL PROTECTED]      
                                            
                      com>                     cc:                                     
                                            
                                               Subject:  Re: Array Serializer and 
java.util.List                                   
                      02/28/2002 02:32                                                 
                                            
                      AM                                                               
                                            
                      Please respond to                                                
                                            
                      axis-user                                                        
                                            
                                                                                       
                                            
                                                                                       
                                            



Hi Rich,

Thanks for the reply.

Isn't the expected xml element for a List - SOAP-ENC:Array with the
arrayType
set to xsd:anyType ?? Shouldn't a List be treated the same way as an Object
[] ?? Why should any
assumptions be made?? I think this is what any non-axis client also
expects. Whether the List
contains objects of the same class or not, it should be treated the same
way. Please let me know
if I am wrong.

In fact, the current behavior causes the ArrayDeserializer also to break
down. By looking at the
arrayType information it expects all the child elements to be of the same
type and it is
surprised to find things to the contrary and currently it returns a null
for the whole
SOAP-ENC:Array.

There is another small but related issue. A List passed from one side
always comes out as an
Object[] on the other side. On the client side one could use
JavaUtils.convert and get it back
as a List. But on the server side it is a problem. Some smart reflection
has to be done on the
service class when any of its methods use a List as a parameter.

Vikram

R J Scheuerle Jr wrote:

> Great observation!
>
> It makes sense to me that the component types of a List object should
> always be considered as an Object.
> The code should not look at the actual data to determine the type.  (The
> elements of the List could be missing, mixed or null).
>
> This is one of those situations where the serialization runtime does not
> have enough information to serialize the object.
> In this case, the javaType and the xmlType are both needed.  Since the
> current Axis runtime does not know the expected
> xmlType, it makes some big assumptions!

> I will run some experiments to see if any tests break.
>
> Any other comments?

> Rich Scheuerle
> XML & Web Services Development
> 512-838-5115  (IBM TL 678-5115)
>
>
>                       Vikram Rayabhari
>                       <vikram@yasutech.        To:
[EMAIL PROTECTED]
>                       com>                     cc:
>                                                Subject:  Array Serializer
and java.util.List
>                       02/27/2002 07:34
>                       AM
>                       Please respond to
>                       axis-user
>
>
>
> Hi,
>
> There seems to be a bug in ArraySerilizer when a list containing objects
> of different classes is serialized. The arrayType attribute is being set
> to the type of the first element in the list and not to xsd:anyType as
> would be expected.
>
> Could someone please clarify?
>
> thanks
> Vikram




Reply via email to