在android中解析soap消息

时间:2014-05-29 10:52:39

标签: android soap

我有这条肥皂消息

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<S:Body>
    <ns2:getClienteResponse xmlns:ns2="http://EntityPackage/">
        <return>
            <cognome>Neri</cognome>
            <email>franco.neri@libero.it</email>
            <idCliente>1</idCliente>
            <indirizzo>via monfalcone 12</indirizzo>
            <nome>Franco</nome>
            <password>ciao</password>
            <telefono>0115700654</telefono>
            <username>franco.neri</username>
        </return>
    </ns2:getClienteResponse>
</S:Body>
</S:Envelope>

我如何捕捉属性? 我尝试了但它给了我:&#34; getClienteResponse {}&#34; 0属性和0属性

SoapObject result = (SoapObject) envelope.bodyIn; 

1 个答案:

答案 0 :(得分:0)

我正在使用此代码:

int i = 0;
while (i < propertiesNumber) {
    result.getProperty(i).toString();
    i++;
}