你有没有尝试过这样的事情:
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>