2013-03-03 216 views
2

我从未见过这种类型的错误,当我发送请求我收到此消息:呼叫SOAP服务从机器人

anyType的{SendResultCode = Unsuccessfull;错误=值不能为空。 参数名称:地址; }

我没有任何地址参数。

下面是从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(); 

UPDATE

,我发现我的问题,这是有点棘手,

字符串的soapAction = “http://www.xxxxxxxx.ge/SendMail

这个URL需要 '/' 在这样的结尾:

字符串的soapAction = “http://www.xxxxxxxx.ge/SendMail/

所以现在一切正常。

+0

也许web服务已发生变化,出现了新的参数的地址,这是不是你的代码 – MUG4N 2013-03-03 20:47:01

+0

的Web服务发送的工作时,我把它从PHP – 2013-03-03 20:47:40

+0

检查了这一点:http://stackoverflow.com/questions/12337137/soapobject-result-returns-anytype-as-value-when-retuning-a-complextype-object – MUG4N 2013-03-03 20:50:51

回答

1

您还没有添加地址参数SoapObject

soapObject.addProperty("address","#fdfdsf asdasd asdasds"); 
+0

没有服务没有地址参数,我更新了我的问题,我发现了我的问题,看看你是否感兴趣。 – 2013-03-05 08:50:32