你嘗試過這樣的事情:
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>