Domanda

I am new to android and trying to parse this since 2 hours now.. Can anyone please help in parsing this response?…

getUserIdResponse{return=[member{member_id=123123; }]; }

This is a Android-kSoap2 response which I get in a SoapObject variable..

SoapObject result = (SoapObject)retObj;
if (result.getPropertyCount() > 0){
    Object obj = result.getProperty("0");

in obj I get this..

[member{member_id=123123; }]

and whatever I do after this gives me exceptions of casting.

SoapObject j = (SoapObject)obj;
Vectormember resultVariable = new Vectormember(j);

this is what I've tried…

thanks in advance ..

È stato utile?

Soluzione

I was finally able to parse the Android-kSoap2 response using this

Object obj = result.getProperty(0);
Vector<SoapObject> vec = (Vector<SoapObject>) obj;
SoapObject so = (SoapObject)vec.get(0);
String memberId = so.getProperty(0).toString();

This gave me the exact Id i needed.. :)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top