webservice on android with ksoap2 too slow

蹲街弑〆低调 提交于 2020-01-16 14:33:10

问题


I have an android application acessing an webservice that returns a big result. The return type, on the webservice C# server, is the type XmlElement. My problem is, when I call it using ksoap2 on the android app, it takes a lot of time to process the result. As the result is a xml, how can I force the ksoap to give me an String result without process it into a SoapObject? Or there is another way to process the result more quickly?

Thanks and sorry for my bad english


回答1:


I guess http get or post and sax xml parser can be used without soap. You will get faster response, smaller app size.




回答2:


You need to run it in an async task and break it down to ensure the result xml is not too big. The WSDL does not matter since it is not used.

In terms of processing the xml with something else rather than using the parsed SoapObject tree:

If you do that you might as well not use KSAOP2. And you probably wont find anything faster either since KSOAP2 is already very lightweight and fast. You just use a different stack to do the same thing.



来源:https://stackoverflow.com/questions/6498563/webservice-on-android-with-ksoap2-too-slow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!