2011-08-12 4 views
0

나는 Android 개발자이며 SOAP을 사용하여 xml 형식의 서버에서 응답을받습니다. 아래는 내가 사용하고 코드입니다 :비누 응답의 xml에서 특정 태그를 얻는 방법

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());   
}

내가 XML 태그 형식의 응답을 얻고 있지만 응답에서만 photourl 태그를 필요는 어떻게 얻을 수 있습니까?

+0

사용중인 SOAP libary : 비누 요청을 쓰려면 /이처럼 보이는, 당신이 그렇게 soapUI 소프트웨어를 사용할 수 있습니다 enveloppe? –

답변

0

답변을 분석하여 필요한 데이터를 얻거나 수동 비누 요청을 작성하여 원하는 것을 얻으십시오. Whit SAX 예 :

수동으로 서면 요청을 보내려면 this code을 사용할 수 있습니다.

  <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> 
관련 문제