XML / SOAP Attributes for Complex Type in kSOAP
I am trying to parse a SOAP response containing a nested ComplexType
one using the kSOAP library on Android 2.1.
<event att1="value1" att2="value2" att3="value3">
<tag2> ... </tag2>
<tag3> ... </tag3>
</event>
I have implemented my own class Event
that implements org.ksoap2.serialization.KvmSerializable
to parse this answer.
It's not clear to me if and how I can parse / deserialize the attributes ( att1
, att2
and att3
) of a Event
node. Is this possible with the current kSOAP implementation?
Thanks.
a source to share
As far as I know, reading attributes is not possible with the kSOAP library. So I would rather not use it.
EDIT: After searching the web, I found out that there seems to be a fix that allows the attributes to be read. I think you can download it here, but I'm not sure if it is correct: Download link
But by the way, these guys managed to get it to work:
(the last few posts discuss it ).
Hope this helps. Let me know if you get it.
ANOTHER CHANGE: Try this link. It definitely works with reading attributes with kSOAP:
a source to share
I am the author of the attribute patch and am now a developer on the ksaop2-android project. http://code.google.com/p/ksoap2-android/
Parsing attributes definitely works with code from my project version 2.5.1 and latest 2.5.2. I am using it in an app living in the android market with no problem.
See the wiki page on how to use it:
http://code.google.com/p/ksoap2-android/wiki/HowToUse
and also have a look at some of the links on the wiki links page for how to get marshalling to work.
a source to share