In my case, I have a soap response which has an “ArrayOfArrayOfString” type of values stored in it.
It is like an Array A[4][4].
A[0][0] -> ServiceId
A[0][1] -> ServiceName
A[0][2] -> ServiceImageURL
A[0][3] -> ServiceDecription
A[0][4] -> ServiceIconURL
and its all same upto A[4][4].
How can I handle this type of response in android?
Code is something like:
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE transportSE = new HttpTransportSE(URL);
transportSE.debug = true;
Log.i("WebService", "msg:try_out");
String[] columns = null;
ArrayList<String> rows = new ArrayList<String>();
try
{
Log.i("WebService", "msg:try+in");
transportSE.call(SOAP_ACTION, envelope);
Log.i("WebService", "msg:SoapObject");
SoapObject response = (SoapObject)envelope.getResponse();
Log.i("WebService", "Response");
try
{
// WhaT SHOULD I USE HERE to convert it to 2D Array//
}
catch (Exception e)
{
e.printStackTrace();
Log.v("CATCH BLOCK", e.getMessage());
}
}
catch (Exception e)
{
e.printStackTrace();
Log.i("WebService", "msg:Exception error");
Log.i("WebSerivce", e.getMessage());
return e.getMessage();
}
Please help me regarding this.
This is the perfect working code to parse the complex data…
I am only doing this for A[0][1-4] and according to my soap response modify the code according to ur soap response.
Now define lameParser() method:-