你调用的对象是空的

时间:2016-06-16 11:27:49

标签: php soap

在尝试调用此SOAP API时,它告诉我Object reference not set to an instance of an object

enter image description here

我这样做

$client = new    SoapClient("http://gateway.XXXXXXX/gateway/api/creditcards/creditcardAPI.asmx?wsdl");

$params = array("clsCreditCardAPIBE" => (Object) array(
   "Username" => 'blabla',
   "Password" => "Barrel of Oil",
   "ProviderPIN" => 500,
   "AccountID" => 1234
    .......
));


$response = $client->__soapCall("Initiate_Deposit", $params);

我做错了什么?

1 个答案:

答案 0 :(得分:0)

您必须先生成客户端,然后再开始使用

$client = new SoapClient("http://yourdomain.com?wsdl");