2012-03-20 2 views
2

나는 ksop 요청을했습니다. 내가 생산하는 반죽은Ksoap 역방향 결과

<ns4:senddata> 
     <connectionId xsi:type="xsd:string"> 
     asdfdsafdsfasdfdsa 
     </connectionId> 
     <tws xsi:type="ns4:tws"> 
      <message xsi:type="xsd:string"> 
       this test message with a message id 
      </message> 
      <messageId>123</messageId> 
      <num xsi:type="SOAP-ENC:Array" 
        SOAP-ENC:arrayType="xsd:string[3]" 
        SOAP-ENC:offset="[0]"> 
       <item xsi:type="xsd:string">977</item> 
       <item xsi:type="xsd:string">496</item> 
      </num> 
     </tws> 
    </ns4:senddata> 

이고 당신이 connectionID 하단이 아닌 상단에 참조로 내가 얻을 것은

<senddata xmlns= WSDL_TARGET_NAMESPACE > 
     <tws> 
      <num> 
       <item xsi:type="xsd:string">977</item> 
       <item xsi:type="xsd:string">496</item> 
      </num> 
      <message i:type="d:string"> 
       this test message with a message id 
      </message> 
      <messageId>123</messageId> 
     </tws> 
     <connectionId xsi:type="d:string"> 
     asdfdsafdsfasdfdsa 
     </connectionId> 
    </senddata> 

입니다.

private class smsSendRequest extends AsyncTask<String, Void, String> { 
@Override 
protected String doInBackground(String... urls) { 
String reSultstr = null; 
for (String url : urls) { 
    SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE, url); 
    request.addProperty("connectionId", did); 

     SoapObject tws= new SoapObject("", "tws2"); 
    tws.addProperty("message", "message contents"); 
    tws.addProperty("messageId", "123"); 

     SoapObject num= new SoapObject("SOAP-ENC:Array", "mobiles"); 
    num.addProperty("item", "496"); 
      num.addProperty("item", "977"); 
      tws.addSoapObject(num); 
    request.addSoapObject(tws); 

     SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
    envelope.dotNet = true; 
    envelope.setOutputSoapObject(request); 
    HttpTransportSE httpTransport = new HttpTransportSE(SOAP_ADDRESS); 
    try { 
     httpTransport.debug = true; 
     httpTransport.call(SOAP_ACTION, envelope); 
        SoapObject response = (SoapObject)envelope.getResponse(); 
        reSultstr = response.getProperty(0).toString(); 
     } 
    catch (Exception exception){ 
     reSultstr = exception.toString(); 
     } 
    } 
    return reSultstr; 
    } 

전 2.6로 전환하면 내가 Ksoap2 2.5.8 을 사용하고 있습니다.이 요청을 보냅니다 * 그냥 치명적인 오류 전에. 누군가가 무엇이 잘못되었는지 확인할 수 있습니다. 두 개의 다른 ksop 요청을 가지고 있지만 모두 괜찮습니다.하지만이 노드에는 여분의 tws 노드가 있습니다. 문제는 ConnectionId가 먼저 반죽된다는 것입니다.

+0

HI 존, 나는 DataContantSeriliazation 유형 XML을 보유하고있는 WCF 웹 서비스의 접근에 동일한 문제에 직면하고있다. 몇 시간 만 있으면 나를 도울 수 있습니까? 미리 감사드립니다. –

+0

기꺼이 도울 수는 있지만 문제를 해결하지 못하고 버려졌습니다. 그러나 내가이 코멘트에 가지고 있던 역방향 결과는 KSOAP의 제작자에 의해 수정되었습니다. – John

답변