axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Balakrishna, Vandana (Cognizant)" <Vanda...@pun.COGNIZANT.COM>
Subject RE: Odd problem
Date Wed, 09 Apr 2003 15:53:34 GMT
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: [Ljava.lang.Object;
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