0

I am an android developer and I use SOAP to get responses from the server in xml format. Below is the code I am using:

SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE,OPERATION_NAME);

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
    SoapEnvelope.VER11);
envelope.dotNet = true;

envelope.setOutputSoapObject(request);

HttpTransportSE httpTransport = new HttpTransportSE(SOAP_ADDRESS);

try
{
    httpTransport.call(SOAP_ACTION, envelope);         
    Object response = envelope.getResponse();         
    textView.setText(response.toString());
}
catch (Exception exception)
{         
    textView.setText(exception.toString());         
}

I am getting response in xml tag format but I need only photourl tag from the response, how to get that?

JK.
  • 5,126
  • 1
  • 27
  • 26
Sando
  • 1,893
  • 11
  • 29
  • 45

1 Answers1

0

Parse the answer to get the needed datas or write a manualy soap request to get only what you want. Whit SAX for example

To send a manualy written request you can use this code which works. To write the soap request/enveloppe you can use soapUI software which do that, this looks like :

            <soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"
             xmlns:plan=\"http://...\" xmlns:com=\"...\"> 
            <soapenv:Header/>
              <soapenv:Body> 
               <plan:..>
                     <com:..> ... </com:..> 
               </plan:..>
              </soapenv:Body> 
            </soapenv:Envelope>
Community
  • 1
  • 1
Dsandre
  • 312
  • 1
  • 5
  • 14