Skip to content Skip to sidebar Skip to footer

Expecting Nested Xml Structure But Receiving Soap Structure

I'm making an app that is requesting data from a Web Service (implementing Soap). People who are viewing this pleaase post doubts in comments... I havent got any response to the qu

Solution 1:

Try this:

StringresponseXML= httpTransport.responseDump;
  • HttpTransportSE.responseDump gives you response in XML format.
  • HttpTransportSE.requestDump gives you request in XML format.

However to be able to change and retrieve any of these values you must set the debug field of HttpTransportSE to true so your code should look like...

HttpTransportSEhttpTransport=newHttpTransportSE(url);
    httpTransport.debug =true;      
    try {
        httpTransport.call(SOAP_ACTION, envelope);          
        xml = httpTransport.responseDump;
        Log.d("xml:", "is:" + xml);     
    }

Also you can parse your response like as follow:

ArrayList<String> listValues = newArrayList<String>();

            httpTransport.call(SOAP_ACTION, envelope);
            SoapObjectresponse= (SoapObject) envelope.getResponse();

            SoapObjectsoapSOBKeyList= (SoapObject) response.getProperty("SOBKeyList");

            intkeyCount= soapSOBKeyList.getPropertyCount();

            for (inti=0; i < keyCount; i++) {
                Stringvalue= soapSOBKeyList.getPropertyAsString(i);
                listValues.add(value);
            }

            return listValues;

Post a Comment for "Expecting Nested Xml Structure But Receiving Soap Structure"