开发者

Error in parsing xml from web service

I have my xml file as a response in result.getProperty(0)开发者_开发百科.

The code is as follows:

SoapObject result=(SoapObject)envelope.bodyIn;    
System.out.println("value of result " + result);  

How can I store this xml in result.getProperty(0) into my sdcard/any other location so that I can parse it using SAXParser?

Regards,

sneha


The getProperty(int)-method returns an Object. If this Object is a String, the SAXParser supports parsing XML from a String: Link


I solved the problem in the following way :

xr.parse(new InputSource(new ByteArrayInputStream(result.getProperty(0).toString().getBytes())));  

Then I use SAXParser and parse the xml.

Thanks,
Sneha

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜