我从未见过这种错误,当我发送请求时,我收到了这条消息:
anyType{SendResultCode=不成功;错误=值不能为空。参数名称:地址;}
我没有任何地址参数。
这是来自java的代码
String methodName = "SendMail";
String namespace = "http://www.xxxxxxxx.ge";
String soapAction = "http://www.xxxxxxxx.ge/SendMail";
String url = "http:///xx.xxx.xx.xxx/SmsService/SmsSendingService.asmx";
SoapObject soapObject = new SoapObject(namespace, methodName);
soapObject.addProperty("from","someaddress");
soapObject.addProperty("to","someaddress");
soapObject.addProperty("cc","someaddress");
soapObject.addProperty("bcc","someaddress");
soapObject.addProperty("subject","Message From App");
soapObject.addProperty("replyTo","someaddress");
soapObject.addProperty("messageBody","Some text here");
soapObject.addProperty("isFormatHtml",true);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(soapObject);
HttpTransportSE conn = new HttpTransportSE(url);
conn.call(soapAction, envelope); //send request
SoapObject result=(SoapObject)envelope.getResponse();
更新
我发现了我的问题,这有点棘手,
字符串soapAction =“ http://www.xxxxxxxx.ge/SendMail ”
这个 URL 最后需要 '/',如下所示:
字符串soapAction =“ http://www.xxxxxxxx.ge/SendMail/ ”
所以现在一切正常。