Returning an array of strings from an OMElement response.
Sanjay Vivek
Greenhorn
Joined: Jan 16, 2008
Posts: 8
posted
0
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
posted
0
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.