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>
和我所得到的是
<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;
}
我使用Ksoap2 2.5.8 如果我切换到2.6,它发送请求*之前只是致命错误。 有人可以看到什么是错的。 我有两个其他ksop请求,一切都很好,但这一个有额外的TWS节点,我相信问题是ConnectionId揉来第一。
HI约翰, 我在WCF Web服务的访问,其中有DataContantSeriliazation类型的XML面临着同样的问题。你可以帮助我,如果你有一些时间..在此先感谢 – 2012-06-22 09:35:32
乐于帮助,但无法解决我的问题,并已放弃它。然而,我在这个评论中遇到的落后结果已被KSOAP的创造者所修复 – John 2012-06-26 01:37:56