I’m getting ArrayList of complex objects using KSOAP2 library based on this tutorial:
And I’m able to receive arrayList of objects. The problem is when the envelope have just one object… When I do:
//...Call webservice
Vector<SoapObject> vectorOfSoapObject = (Vector<SoapObject>)envelope.getResponse();
//pass Vector to ArrayList
It returns me an ClassCastException on this line, when I have just one object on the envelope. When I have more it works fine (I made debug to see this happening)…
What could be the problem?
I was able to solve this problem. Using the suggestion of @Pranalee, I made this: