解析ksoap2响应 [英] Parsing ksoap2 response
问题描述
我用一个ksoap2 LIB来自Android客户端与SOAP Web服务通信。伟大的工作是由KSOAP团队完成的,但问题是,有没有什么好的例子,如何把它用在不同的方面是正确的。比如我得到的SOAP响应以下数据:
I use a ksoap2 lib for communicating from android client with SOAP web service. Great job was done by ksoap team, but the problem is, there is no any good example how to use it correct in different aspects. For instance I get in soap response following data:
anyType{
StatusSetting=anyType{Id=1; Name=Til afskrivning; LocationId=1; Editable=true; Default=true; Transcribed=false; };
StatusSetting=anyType{Id=2; Name=Afskrevet; LocationId=1; Editable=false; Default=false; Transcribed=true; };
...
}
这是一个复杂的对象,或者更确切地说StatusSetting对象的集合。 当我试图让SoapObject的属性它只有1所有这些数据作为一个字符串属性。它不能太解析为JSON。令人难以置信,没有人遇到了关于向普及Android是获得同样的问题。会很冷静地知道,如果有人解决了这个问题,以及如何。 谢谢你。
It's a complex object, or rather a collection of StatusSetting objects. When I try to get a property of SoapObject it's only 1 property with all that data as a string. It can't be parsed as json too. Unbelievable that nobody met same problem regarding to popularity android is gaining. Would be very cool to know if somebody solved this issue and how. Thanks.
推荐答案
下面是一个的教程如何与KSOAP 复杂对象的数组工作。我发现无数个小时的调试。希望这hepls
Here is a tutorial on how to work with array of complex objects with KSOAP. I found out by countless hours of debugging. Hope this hepls
这篇关于解析ksoap2响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!