解析 ksoap2 响应 [英] Parsing ksoap2 response

查看:18
本文介绍了解析 ksoap2 响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 ksoap2 库从 android 客户端与 SOAP 网络服务进行通信.ksoap 团队做得很好,但问题是,没有任何很好的例子如何在不同方面正确使用它.例如,我收到以下数据的肥皂响应:

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 处理复杂对象数组的教程.我是通过无数个小时的调试发现的.希望这有帮助

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆