drmgg4411 2019-06-28 11:41
浏览 101

调用方法“服务器无法处理请求”时出现肥皂错误。

Having this wsdl url

https://backoffice.voipinnovations.com/Services/APIService.asmx?wsdl

Trying to call the SendSMS API method, getting the following error

Fatal Error: Uncaught SoapFault exception: [soap:Server] System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object. at VIBackOffice.Services.APIService.SendSMS(String login, String secret, String sender, String recipient, String message)

This is how i do it with PHP

$client = new SoapClient('https://backoffice.voipinnovations.com/Services/APIService.asmx?wsdl', ["trace" => 1]);
$params = [
"login"     => 'login',
"secret"    => 'secret',
"sender"    => 'sender',
"recipient" => 'recipient',
"message"   => 'message'
];

$result = $client->SendSMS($params);
//or
$result = $client->__soapCall("SendSMS", $params);
//or even
$result = $client->SendSMS('login', 'secret', 'sender', 'recipient', 'message');

Whatever i tried, it failed with that error. Is it the way i form my request body, or is it the service's API?

Edit: Using single quotes for param keys worked.

  • 写回答

0条回答 默认 最新

    报告相同问题?