axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Daniels <gdani...@macromedia.com>
Subject RE: How to deal with a Vector
Date Fri, 08 Feb 2002 18:42:25 GMT

I just wanted to give you a quick explanation of this behavior while we're at it.

All Java arrays and Lists (anything implementing List) will be serialized by default as a
SOAP array to maximize interoperability with other toolkits.  All INCOMING SOAP arrays are
automatically deserialized to ArrayLists, since they're the easiest to deal with (fast and
dynamically sized).  The convert() function Rich told you about allows the engine to automatically
do the right thing on the server side for arguments... i.e. if you have a service method like
this:

  public void method(Vector param1)

...and it gets a SOAP array as the first parameter, we know by introspection that a Vector
is desired, so we can convert it.  On the client side, there's no way to know exactly what
you'd like back from the invoke() for a SOAP array return, so we just give you the ArrayList
for now.

--Glen

> -----Original Message-----
> From: Chauviaux, Patrick [mailto:patrick.chauviaux@be.unisys.com]
> Sent: Friday, February 08, 2002 12:48 PM
> To: 'axis-user@xml.apache.org'
> Subject: RE: How to deal with a Vector
> 
> 
> Here is the client code:
> 		String endpoint = url+"HomeScenarioServer.jws";
>             Service  service = new Service();
>             Call     call    = (Call) service.createCall();
>             call.setTargetEndpointAddress( new 
> java.net.URL(endpoint) );
>             prefs = (Vector) call.invoke("updatePreference",  
> new Object[] {
> cfg.getConsumerID() } );
> It generates an exception with the message: java.util.ArrayList.
> I suppose, as I said, that it is a problem of serialization 
> for a Vector.
> That would be great if you could send me a simple example (if possible
> documented) explaining how to deal with that problem.
> Thanks in advance
> 
> Patrick
> 
> -----Original Message-----
> From: R J Scheuerle Jr [mailto:scheu@us.ibm.com]
> Sent: Friday, February 08, 2002 6:43 PM
> To: axis-user@xml.apache.org
> Cc: 'axis-user@xml.apache.org'
> Subject: Re: How to deal with a Vector
> 
> 
> Define "doesn't work".
> 
> Do you get an exception?
> 
> I can try a test if I have time.. but if you could provide more
> information.
> 
> 
> 
> Rich Scheuerle
> XML & Web Services Development
> 512-838-5115  (IBM TL 678-5115)
> 
> 
>  
> 
>                       "Chauviaux, Patrick"
> 
>                       <patrick.chauviaux@be.        To:
> "'axis-user@xml.apache.org'" <axis-user@xml.apache.org>       
>            
>                       unisys.com>                   cc:
> 
>                                                     Subject:  
> How to deal
> with a Vector                                                
>                       02/08/2002 11:25 AM
> 
>                       Please respond to
> 
>                       axis-user
> 
>  
> 
>  
> 
> 
> 
> 
> Hello all,
> 
> My problem is that I have a method on the server side that returns a
> java.util.Vector. When I make an AXIS SOAP call to this 
> method it doesn't
> work. I suppose I have to use the VectorDeserializer class to 
> do that but
> it
> is rather difficult to understand how it works. Can someone send me a
> complete example of how I should use it?
> Thanks!
> 
> Patrick
> 
> 

Mime
View raw message