Returning an array of strings from an OMElement response.
Joined: Jan 16, 2008
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);
author and deputy
Joined: Jul 13, 2001
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.