-2

How to parse the below soap response. particularly for the response "Result". Please help me on this. Thanks in advance.

ResponseDump

     <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <soap:Body>
        <RegisterWithEmailIdResponse xmlns="http://tempuri.org/"><RegisterWithEmailIdResult>
<RegisterWithEmailId xmlns="">
                <RegisterWithEmailId>
    <Result>1</Result>
</RegisterWithEmailId>
    </RegisterWithEmailId>
</RegisterWithEmailIdResult>
        </RegisterWithEmailIdResponse>
        </soap:Body>
        </soap:Envelope>

Actual response

anyType{RegisterWithEmailId=anyType{Result=1; }; }

user2634966
  • 179
  • 1
  • 16
  • https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=parse+soap+response+in+android – Kanak Sony Jun 04 '14 at 13:45

1 Answers1

1

Finally got it

anyType{RegisterWithEmailId=anyType{Result=1; }; }

You have to parse the above soap response as follows

SoapObject res;
                try {
                    res = (SoapObject) result
                            .getProperty("RegisterWithEmailIdResult");
                    res = (SoapObject) res.getProperty("RegisterWithEmailId");
                    res = (SoapObject) res.getProperty("RegisterWithEmailId");
                    state = res.getPropertyAsString(0).toString();

                } catch (Exception e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
user2634966
  • 179
  • 1
  • 16