aspose file tools
The moose likes Web Services and the fly likes Axis2 client: retrieving array returned from server Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "Axis2 client: retrieving array returned from server" Watch "Axis2 client: retrieving array returned from server" New topic
Author

Axis2 client: retrieving array returned from server

Doug Slattery
Ranch Hand

Joined: Sep 15, 2007
Posts: 294
I think I'm missing something regarding this. I've created and deployed a web service with a method that returns an array (not Array). This is my first attempt at accessing complex data types with Axis2. Take this simple example (don't scrutinize the code, I'm winging it just to make the point):

Class to be returned by service as an array:

And the service:

Now create the service, deploy and create the client. This is the way I've been using the stubs:

I've been using this style to access primitives and the default basic data type objects. When I try the above example I'm getting Cannot cast from OMElement to People[].

This error makes sense to me, but I'm searching for the missing link to retrieve the array.

Any ideas?

Aloha,
Doug

-- Nothing is impossible if I'mPossible
[ April 04, 2008: Message edited by: Doug Slattery ]
Doug Slattery
Ranch Hand

Joined: Sep 15, 2007
Posts: 294
I figured it out...

It wasn't res.get_return();

It was public List PeopleMenu() instead of public People [] PeopleMenu() :roll:

Sometimes google can be evil by leading you down the wrong path

Aloha,
Doug

-- Nothing is impossible if I'mPossible
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Axis2 client: retrieving array returned from server
 
Similar Threads
how comparator works?
complex data type in axis 2 web service
Sorting arraylist on the basis of object
Axis 2 tutorial - client class compliation error
Multi-dimensional array