I'm trying to parse a SOAP response that contains nested ComplexType
s using the kSOAP library on Android 2.1.
<event att1="value1" att2="value2" att3="value3">
<tag2> ... </tag2>
&l开发者_如何学编程t;tag3> ... </tag3>
</event>
I've implemented my own class Event
that implements org.ksoap2.serialization.KvmSerializable
to parse this response.
It is not clear to me if and how I can parse/deserialize the attributes (att1
, att2
and att3
) of the event
node. Is it even possible with the current kSOAP implementation?
Thanks.
I am the author os the attribute patch and now the project maintainer of ksaop2-android. http://code.google.com/p/ksoap2-android/
Attribute parsing definitely works with the code from my project version 2.5.1 and the latest 2.5.2. I am using it in an application that is live in Android market without problems.
See the wiki page on how to go about using it:
http://code.google.com/p/ksoap2-android/wiki/HowToUse
and also see some of the links in the wiki links page to see how to get marshalling to work.
As far as I know, reading attributes is not possible with the kSOAP library. That's why I'd rather not use it.
EDIT: after searching on the web for a bit I found out that there seems to be a patch out which makes it able to read attributes. I think you can download it here but I'm not sure if it's the right one: Link to Download
But apperently these guys somewhat managed to get it to work:
(last few posts are discussing it).
Hope this helps. Let me know if you figured it out.
ANOTHER EDIT: Try this link. It definitely works in reading attributes with kSOAP:
This Post
精彩评论