Skip to content Skip to sidebar Skip to footer

Soap Xml In Return - Android

I'm using k2SOAP for Android when dealing with webservices. SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); request.addProperty('ProjectID', 1); SoapSerializationEnve

Solution 1:

Two Things you need to change

1)Add this "httpTransport.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"utf-8\"?>");"

line above "httpTransport.call(SOAP_ACTION, soapEnvelope);"

2) String resultString = result.toString();

Replace the above line with following one

String resultString=httpTransport.responseDump;

This will return response as xml formated String

Solution 2:

The provided answer did not work for me rather lines bellow worked for me. Try the following lines, hope this will give you data with XML tags,

httpTransport.debug=true; 
httpTransport.call(SOAP_ACTION, soapEnvelope);
String ss=httpTransport.responseDump; 
Log.d("Result --- ", ss);

This will print the complete xml file which has been returned by the web service.

Solution 3:

Try it this WAy .

try {

    httpTransport.call(SOAP_ACTION, soapEnvelope);
    SoapObjectresult= (SoapObject) soapEnvelope.getResponse();


Stringelement= ((SoapObject)result.getPropertySafely("schema")).getPropertySafely("element").toString(); 

Post a Comment for "Soap Xml In Return - Android"