tags:

views:

174

answers:

0

Hello, ksoap-newbie here

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/"&gt;
    <S:Body>
        <ns2:getNamesResponse xmlns:ns2="http://namespace/"&gt;
            <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