I am using KSOAP2 to call a .NET webservice from android application,and the response from the web service is in the following format
anyType{
UserName=anyType{};
Password=anyType{};
ApplicationCode=JOB;
ActionType=Query;
MessageParameters=anyType{Parameters=anyType{}; };
TableData=anyType{TableNo=167;
TableName=Job;
DataRows=
anyType{
DataRow=
anyType{
DataRowValues=
anyType{
DataRowValue=
anyType{
FieldNo=1;
FieldName=No.;
PrimaryKey=true;
FieldType=Code20; DataValue=DEERFIELD, 8 WP;
};
DataRowValue=
anyType
{
FieldNo=3;
FieldName=Description;
PrimaryKey=false;
FieldType=Text50;
DataValue=Setting up Eight Work Areas;
};
DataRowValue=
anyType
{
FieldNo=4;
FieldName=Description 2;
PrimaryKey=false;
FieldType=Text50;
DataValue=anyType{};
};
};
};
};
};
};
ResponseForRequest=GETTABLEDATA;
CustomIdentifier=TestBB;
Applications=anyType{};
Forms=anyType{};
Menu=anyType{};
}
I am not aware about the format of this response and i don’t know how to parse this response to get particular result.Any one knows about it please help me.
Note: i manually formatted this response for your understanding.
Actually this a known format if you know Java Script.These data in this format are infact
JSON Object‘s andJSON Array‘s. I hope you are using theKSOAP2 library.So here is how you can parse this result.eg:
Initially i had a lot of trouble with this kind of data but finally i got it all working.From then I have been using this.I hope this helps you solve your problem.