我在.NET Web服务中有一个图像,我有ArrayOfBase64Binary = parent
& base64Binary = child
个标签。我无法在Android中检索XML文件。我正在使用SOAP Web服务ksoap2-android-assembly-2.6.2-jar-with-dependencies.jar
。
有人可以帮我检索xml&解析它?
提前致谢。
答案 0 :(得分:0)
anyType{}
显然意味着您从SOAP获得NULL
值。
可能是您应该调试Web服务并查看它是否也返回任何值。
或者尝试将SOAP Library
更新为ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar
以下是解析数据的方法
SoapObject result = (SoapObject) envelope.bodyIn;
Log.e("result", result.toString());
SoapObject resultOne = (SoapObject) result.getProperty(0); //Inside the first tag
SoapObject resultTwo = (SoapObject) resultOne.getProperty(0); //Inside the second tag
Log.e("Count", resultTwo.getPropertyCount()+"");
for (int i = 0; i < resultTwo.getPropertyCount(); i++) {
SoapObject resultThree = (SoapObject) resultTwo.getProperty(i);
Log.e(""+i, resultThree.toString());
String id = resultThree.getProperty("Id").toString();
String PartName = resultThree.getProperty("Part_Name").toString();
}