I am using ksoap2 webservice from my android application. I get the following Response from the server:

validateUserResponse{return=anyType{authenticated=true; contactNumber=9856456589; 
***currentAssignedVillagesName=Vavol; currentAssignedVillagesName=Chotila; 
currentVillageCode=6; currentVillageCode=18;*** dob=697228200000; firstTimeLogin=false; 
id=87; languageCode=EN; password=3r68IuRgxV 7lLT6FylQ5bONeimCbehq; 
serverDate=1367224983096; userContactId=163; userRole=Asha; username=umehta; fName=Umang; 
lName=Mehta; }; }

As in the response there is a variable currentAssignedVillagesName which is an array of String and currentVillageCode array of int.

I am unable to access these variables with getProperty() method. Any solution to this.

有帮助吗?

解决方案

Yes, just do two things as follows:

Add a statement as:

androidHttpTransport.debug = true;

before the call as:

androidHttpTransport.call(SOAP_ACTION, envelope);

and add statement as:

String xml = androidHttpTransport.responseDump;

after the call statement, and you will get the response in XML in the form of XML data as tags and data.

Just parse the data using any parsing method.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top