permaculture playing cards*
The moose likes Web Services and the fly likes Returning an array of strings from an OMElement response. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Returning an array of strings from an OMElement response." Watch "Returning an array of strings from an OMElement response." New topic
Author

Returning an array of strings from an OMElement response.

Sanjay Vivek
Greenhorn

Joined: Jan 16, 2008
Posts: 8
Hi everyone,

I have Web Service that returns an array of strings and I'm using an AXIOM based client to invoke it. My rather simple question is how do I go about extracting the array of strings which is embedded within the OMElement response? The code I have currently as shown below, only returns the first element in the array. Any pointers on how I can return all the elements in an array would be greatly appreciated. Cheers.

OMElement result = sender.sendReceive(getPayload);
String response = result.getFirstElement().getText();
System.out.println(response);


Regards
Sanjay
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
why you are doing only result.getFirstElement() ?
Try to get the ElementCollection from the response and do loop over it to access nodes in it.


Spritle Software Blogs
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Returning an array of strings from an OMElement response.
 
Similar Threads
How to access the JSON reponse from a java client
Sending ArrayList as param to Axis2 web service
splitting arrays
MTOM content transfer - Axis2
No databinding in JAX-WS - wsimport