axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Almeida, Timothy" <>
Subject RE: Odd problem
Date Wed, 09 Apr 2003 16:04:18 GMT
Hi Vandana,
Let me first say that I'm no Axis expert -- but am happy to provide my
understanding/perspective all the same! ;)
I've been using the 1.0 release, and I don't believe there's support for
ArrayLists in any form there. (Don't have the time to verify that -- just my
understanding/belief.) Perhaps there is "some" support for ArrayLists in the
version you are using (RCx). If I were to hazard a guess, I'd guess that the
runtime engine is morphing the ArrayList to some other "supported type" --
say like a Vector or an Array, and that the same type is used when
transmitting in both directions.
(That would explain why your ArrayList goes smoothly from client to server,
and also why your attempt to cast the return value fails -- because you are
not getting an ArrayList back -- but rather, something else [like say a
Vector] ).
Why don't you try doing a <retValue>.getClass() in your client to ascertain
what you are indeed getting back. (That would be interesting to know!)
Good luck,

-----Original Message-----
From: Balakrishna, Vandana (Cognizant)
Sent: Wednesday, April 09, 2003 10:54 AM
Subject: RE: Odd problem

Hi Tim,

There's one thing that I haven't understood. I have been passing ArrayLists
as a parameter in the call.invoke and my services have been working fine.

But for web services that expect arrayLists of objects as the return types,
I get a classcast exception. On checking the logs, I can see that the Soap
response has reached my client its basically a problem of
deserialising the data at my client end. If the deserialising is being done
properly when I send the ArrayList in the request, what is the problem
here?? Don't the two work in the same way????

The exception i get is as follows:
java.lang.ClassCastException: [Ljava.lang.Object;
        at CustomListClient.main(
Exception in CustomListService servicejava.lang.ClassCastException:
java.lang.ClassCastException: [Ljava.lang.Object;

Please help!!! I haven't been able to figure this out!!!


-----Original Message-----
From: Almeida, Timothy []
Sent: Monday, April 07, 2003 9:18 PM
To: ''
Subject: RE: Odd problem

ArrayList is not among the set of supported types that you can readily use
as a parameter or a return type in your service interface. (You could use it
if you created your own serializer & deserializer for it. That's a lot of
trouble for one thing, and for another, it could have interoperability
implications as well.) Stick with the supported types and JavaBeans for
starters. JWS deployment won't get you very far either, so move on to the
more standard means of deployment that involves use of a WSDD (deployment
descriptor) file. (You may not even be able to use JavaBeans with JWS, since
there is no way to specify additional 'type mappings'.)
Hope this helps,

PS: If you haven't already done so, I'd recommend you read the user guide
before going much further - it isn't very long, and goes over all the basic

-----Original Message-----
From: Michael Molloy []
Sent: Monday, April 07, 2003 9:39 AM
Subject: Odd problem

I have a web services app that I deployed by dropping into the
tomcat/webapps/axis folder. I then wrote a client to access the service.
I want the web service to return an ArrayList filled with objects, a simple class that I wrote that uses javabean
get & set methods and has a no parameter constructor.

When I tested, my client app threw a RemoteInvocationException, so I
tried stepping back in my code to a simpler return. This is where things
are confusing to me. The following code is from my web service, and it
works correctly.

        while( {
           // Participant p = new Participant();
           // p.setName(rs.getString(2)+", " + rs.getString(3));
           // p.setId(rs.getString(1));
           // p.setDate(rs.getString(4));

However, if I uncomment those lines, I continue to get the
RemoteInvocationException, even though I'm no longer adding the
Participant objects to the ArrayList. The exception is thrown in this
line in my client:

       ArrayList al = (ArrayList)call.invoke(new Object[]{});

I'm new to axis & web services, so there is nothing too obvious to point
out. Thanks for any help.


View raw message