你尝试过这样的事情:
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
}
注:这是我使用从资源
这个例子遍历响应SOAP对象的标签列表获取属性的例子,得到每个标记的3个已知属性,参见下文实例响应:
<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>