How to parse a complex SOAP response in Android

前端 未结 4 692
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-07 03:00

Since two days I am trying to consume a WCF (.NET) Soap Service and serialize it\'s response without success. I am getting a correct response (I had to put it on pastebin: S

相关标签:
4条回答
  • 2021-01-07 03:37

    I have the same problem. First I used vtd-xml. It was working without problems but it is a bit slow. Now I switched to standard Java SAX (not Android SAX implementation) and it works ok.

    0 讨论(0)
  • 2021-01-07 03:41

    One of my solutions was: http://vtd-xml.sourceforge.net/

    I hope someone will find something more suitable.

    0 讨论(0)
  • 2021-01-07 03:44

    With ksoap2 you can set the envelope debugging to true and then get the response dump, which will contain the full xml.

    However what makes you think that the SoapObject returned is unreadable. Check it out in a debugger and you will find that everything is there and you can just parse it out using getProperty("propname") and getAttribute("attribute) which in turn are either SoapObjects again if they are nested or contain actual values if they are leaf nodes.

    Check out some of the links on the wiki to http://code.google.com/p/ksoap2-android/

    0 讨论(0)
  • 2021-01-07 03:48

    I have used DOM and SAX so far to parse XML documents. DOM had a few issues on Android and I had to handle some bugs in the API. SAX seems to be better (and leaner if you only read). I have not used ksoap, but did everything hand crafted. Though I am not sure where the problem with that .NET thing is, I wouldn't see an issue using SAX or DOM. Can you comment why you think SAX won't work because of namespaces? A.

    0 讨论(0)
提交回复
热议问题