views:

524

answers:

2

Hi,

I'm trying to parse a SOAP response that contains nested ComplexTypes using the kSOAP library on Android 2.1.

<event att1="value1" att2="value2" att3="value3"> 
   <tag2> ... </tag2>
   <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.

+1  A: 

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: www.sourceforge.net/tracker/?func=detail&aid=1473145&group_id=158028&atid=806189

But apperently these guys somewhat managed to get it to work:

www.supportforums.blackberry.com/t5/Java-Development/KSOAP-not-getting-full-XML/td-p/140388/page/2 (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:

http://www.simpligility.com/2010/05/attribute-support-for-ksoap2-on-android/

Mister Mida