Question

I have a basic soap service running on glassfish, that returns List<String> like this

<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
        <ns2:getNamesResponse xmlns:ns2="http://namespace/">
            <return>Name1</return>
            <return>Name2</return>
        </ns2:getNamesResponse>
    </S:Body>
</S:Envelope>

now in ksoap2 (android) I have to iterate the soap-object properties to get my list back:

SoapObject result = (SoapObject) envelope.bodyIn;

for(int i=0;i<result.getPropertyCount();i++)
{
    list.add(result.getProperty(i));
}

is there a better way? I couldn't find any class mapper in my implementation.

thanks in advance

Was it helpful?

Solution

I am afraid not - you would need to do the mapping yourself.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top