Android soap包解析
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:db_searchResponse xmlns:ns1="urn:hellowsdl2">
<return xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType=":[1]">
<item xsi:type="xsd:">
<dish_number xsi:type="xsd:string"> 100 </dish_number>
<dish_nickname xsi:type="xsd:string"> 杈e瓙楦? </dish_nickname>
<dish_classnumber xsi:type="xsd:string"> 10001 </dish_classnumber>
<dish_describe xsi:type="xsd:string"> 杈e瓙鐐掗浮 </dish_describe>
<dish_price xsi:type="xsd:string"> 10 </dish_price>
<consult_number xsi:type="xsd:string"> 1001 </consult_number>
</item>
</return>
</ns1:db_searchResponse>
</SOAP-ENV:Body>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:db_searchResponse xmlns:ns1="urn:hellowsdl2">
<return xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType=":[1]">
<item xsi:type="xsd:">
<dish_number xsi:type="xsd:string"> 100 </dish_number>
<dish_nickname xsi:type="xsd:string"> 杈e瓙楦? </dish_nickname>
<dish_classnumber xsi:type="xsd:string"> 10001 </dish_classnumber>
<dish_describe xsi:type="xsd:string"> 杈e瓙鐐掗浮 </dish_describe>
<dish_price xsi:type="xsd:string"> 10 </dish_price>
<consult_number xsi:type="xsd:string"> 1001 </consult_number>
</item>
</return>
</ns1:db_searchResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
请问怎么才能把红色部分的数据解析出来啊?
我用
SoapObject resultRequestSOAP = (SoapObject) envelope.bodyIn;
String encodedImage = resultRequestSOAP.getProperty("return").toString();
解析成:
[{dish_number=100;dish_nickname=è¾£å鸡;dish_classnumber=10001;dish_describe=è¾£åç鸡; dish_price=10; consult_number=1001; }]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已解决 我想多了