axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas, Jolly (Cognizant)" <Jol...@pun.cognizant.com>
Subject RE: Odd problem
Date Mon, 07 Apr 2003 15:52:14 GMT
Hi, 
I guess you don't get an ArrayList, instead what you get is an object array.
Check that. Run it thru a for loop and u'll see all ur java object as a object array instead
of an ArrayList.

I faced this similiar problem sometimes back..n till now not able to understand why it sends
an object array. Infact when i send an ArrayList as an input parameter to my service, everything
works fine. At the other end it deserializes it back to ArrayList and executes the service
properly. And if the service is supposed to return an ArrayList, I can view the SOAP response
that a proper response is been formed, still I get an Object array instead of ArrayList.
Any reply to this will be appreciated.

Thanks,
Jolly

-----Original Message-----
From: Michael Molloy [mailto:mmolloy@ncycles.com]
Sent: Monday, April 07, 2003 8:09 PM
To: axis-user@xml.apache.org
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
Participant.java 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(rs.next()) {
           // Participant p = new Participant();
           // p.setName(rs.getString(2)+", " + rs.getString(3));
           // p.setId(rs.getString(1));
           // p.setDate(rs.getString(4));
            al.add("test");
        }

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.

--Michael




Mime
View raw message