File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Returning an array of strings from an OMElement response.

 
Sanjay Vivek
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3150
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic