Sue Sue
Sue Sue

Reputation: 31

How to Parse Ksoap2 Response in Android

I already searched and read a lot of tutorial how to parse Ksoap2 response using C# ASP.net Web Service. It's very confusing what should I pick because the others say that "it's wrong this is the right way" and the others say "no that was also wrong" Now I really don't know what I'm going to use to parse my web service response.

this is my response.

anyType{NewDataSet=anyType{Table=anyType{id=1; autoID=aa; name=bb; company=bb; address=bb; position=bb; email=bb; conTactMobile=bb; contactTelephone=bb; companyLogo=bb; photo=bb; }; }; }

Can anybody suggest what is the best way to parse this kind of response. any thoughts will be Highly appreciated.

Upvotes: 3

Views: 1033

Answers (1)

Amritpal Singh
Amritpal Singh

Reputation: 1002

Well Here are Some steps you can follow to parse your response:

SoapObject response = (SoapObject) envelope.getResponse();

After that extract first property i.e:

SoapObject NewDataSet = (SoapObject) response.getProperty(0);

SoapObject table = NewDataSet.getProperty(0);

get each property in table as,for ex:-

 String iD=table.getProperty(0);
 String autoID=table.getProperty(1);

This is one of the solution(I cant say if it is the best one or not),see is it solves your problem..

Upvotes: 1

Related Questions