Android library for my web service requests. I faced a problem when my web service is returning one node:
<tag1> ... </tag1>
<tag1> ... </tag1>
<tag1> ... </tag1>
<tag1> ... </tag1>
There are some example how to parse if there would one result for one node:
http://seesharpgears.blogspot.com/2010/10/web-service-that-returns-array-of.html
But in my case i can't find any good of those. Maybe some one could share some ideas and could help me.
Thanks.
have you tried something like this:
SoapObject soapObject = envelope.getResponse();
for (int i = 0; i < soapObject.getPropertyCount(); i++) {
SoapObject resource = (SoapObject) response.getProperty(i);
String uri = resource.getAttribute("uri").toString();
String mimeType = resource.getAttribute("mimeType").toString();
String size = resource.getAttribute("size").toString();
String localURI = resource.getAttribute("localURI").toString();
//do stuff
}
note: this is an example I use to get properties from a list of resources
this example loops over the tags of the response SOAP object and gets the 3 known attributes of each tag, see example response below:
<resources xmlns="http://www.example.com/">
<resource mimeType="text/xml" size="123456" uri="https://example.com/content/get.php?a123891" localURI="package.opf"/>
<resource mimeType="application/x-dtbncx+xml" size="123456" localURI="nav.ncx"/>
</resources>