Search code examples
androidweb-servicessoapksoap

Is it possible to swap lines of xml code in soap


I wish to send a request like

<v:Envelope xmlns:i="xxx">
 <v:Header />
 <v:Body>
  <sendTwoWaySmsMessage xmlns="xxx" id="o0" c:root="1">
   <connectionId i:type="d:string">connectionId</connectionId>
   <twoWaySmsMessage>
    <message i:type="d:string">love it. It seems to work</message>
    <mobiles i:type="d:string">345</mobiles>
    <messageId i:type="d:string">123</messageId>
   </twoWaySmsMessage>
   </sendTwoWaySmsMessage>
  </v:Body>
</v:Envelope>

what i get is

<v:Envelope xmlns:i="xxx">
 <v:Header />
 <v:Body>
  <sendTwoWaySmsMessage xmlns="xxx" id="o0" c:root="1">
   <twoWaySmsMessage>
    <message i:type="d:string">love it. It seems to work</message>
    <mobiles i:type="d:string">345</mobiles>
    <messageId i:type="d:string">123</messageId>
   </twoWaySmsMessage>
   <connectionId i:type="d:string">connectionId</connectionId>
   </sendTwoWaySmsMessage>
  </v:Body>
 </v:Envelope>

code is

SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE, url);
SoapObject message = new SoapObject("", "twoWaySmsMessage");
request.addProperty("connectionId", did);

message.addProperty("message", "love it. It seems to work");
message.addProperty("mobiles", "435");
message.addProperty("messageId", "123");

request.addSoapObject(message);
request.setProperty(0, "connectionId");

when i use SoapUI with the second with the "connectionId" swaped it seem to work can anyone help. of have ideas. I have looked at just about every ksoap question out there and cant seem to find an answer?


Solution

  • this turn out to be a issue.

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

    looking forward to the result.