簡體   English   中英

帶有二進制base64圖像的Android XML解析

[英]Android XML parsing with binary base64 image

我在.NET Web服務中有一個圖像,其中有ArrayOfBase64Binary = parentbase64Binary = child標簽。 我無法在Android中檢索XML文件。 我為此使用SOAP Web Service和ksoap2-android-assembly-2.6.2-jar-with-dependencies.jar

有人可以幫助我檢索xml並對其進行解析嗎?

提前致謝。

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();
}   

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM