0

After I getting my response in SOAP I have as a result Object like this:

Object result = envelope.getResponse();

result :[['1/10/2014 11:10:00 PM',1.5,2.2,55.9],['10/10/2014 12:30:00 AM',88.88,88.12,88.99],.....]

casting it to SoapObject throws :

"java.lang.ClassCastException: org.ksoap2.serialization.SoapPrimitive"

SoapObject response = (SoapObject) envelope.getResponse(); // throws error

So I tried:

SoapPrimitive resultsString = (SoapPrimitive)envelope.getResponse();

and I getting a result the same result Object.

ADDED: tried SoapObject response = (SoapObject)envelope.bodyIn; and got a result:

GetCodesResponse{GetCodesResult=[['1/10/2014 11:10:00 PM',1.5,2.2,55.9]....];}

It all return String , and I don't have an option to iterate through it. How can I run loop through result, create an Object type MyCustomClass with the contractor MyCustomClass(Data d,double a, double b, double c) from each Array element and insert them into ArrayList<MyCustom>

6
  • Could you post exception message? Commented Jul 28, 2014 at 11:52
  • Did you try to use SoapObject response = (SoapObject)envelope.bodyIn; instead of (SoapObject) envelope.getResponse(); stackoverflow.com/questions/5799775/… Commented Jul 28, 2014 at 12:04
  • It return something like that : GetCodesResponse{GetCodesResult=[['1/10/2014 11:10:00 PM',1.5,2.2,55.9]....];} Commented Jul 28, 2014 at 12:12
  • Possible that you should use HttpPost and DefaultHttpClient. Example: stackoverflow.com/questions/5167341/… Commented Jul 28, 2014 at 12:29
  • Why? if I getting the result, the problem is just parsing it currect Commented Jul 28, 2014 at 12:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.