I am consuming a SOAP based web-service
using ksoap2
, and receiving a JSON response
from the webservice, which I am storing in a SoapObject
.
The next step is to parse the JSON
. For that I am trying to get each property
from the response SoapObject and store it in another SoapObject
, for further processing (like getting the name
and value
etc.)
SoapObject soapObjectEach= (SoapObject) postResult.getProperty(i);
But I am getting an exception at this statement: java.lang.ClassCastException: org.ksoap2.serialization.SoapPrimitive cannot be cast to org.ksoap2.serialization.SoapObject
postResult is a SoapOject. This suggests me that postResult.getProperty() probably returns a SoapPrimitive? But I am almost certain that it is not the case, as the documentation says, "Returns the desired property"
So can anybody suggest something about it? I have seen other questions about this (1, 2) but did not get to a satisfactory answer.