2

ksopリクエストがあります。私が作るためにこねるものは

<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>

そして私が得るものは

<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>

ご覧のとおり、connectionIDは上部ではなく下部にあります。

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を使用しています。リクエストを送信する前に、致命的なエラーが発生します。誰かが何が悪いのかを見ることができますか。他に2つのksopリクエストがあり、すべて問題ありませんが、これには余分なtwsノードがあり、問題はConnectionIdが最初に来るように調整することです。

4

1 に答える 1

1

Ksoapの問題。

http://code.google.com/p/ksoap2-android/issues/detail?id=113

于 2012-04-07T01:50:03.650 に答える