【问题标题】:Why is Soapclient not recognizing my accountInfo object为什么 Soapclient 无法识别我的 accountInfo 对象
【发布时间】:2014-06-17 17:45:29
【问题描述】:

我正在尝试创建一个 Soap 请求来查询汽车 api。每当我运行呼叫时,都会收到以下客户端错误。

Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object hasn't 'accountInfo' property in ...

但是我已将其定义为属性。相关行如下:

DEFINE ('API_ENDPOINT',"http://services.chromedata.com/Description/7a?wsdl");
DEFINE ('API_SECRET',"xxx");
DEFINE ('API_ACCTNO',"123456");
DEFINE ('DEBUG',"1");
$useridentification = array('accountInfo' =>array('_'=>"",'number'=>API_ACCTNO, 'secret'=>API_SECRET, 'country'=>'US', 'language'=>'EN', 'behalfof'=>'?'));
enter code here
$vinobject = array('vin'=>$vin);
$buildrequest=array($useridentification, $vinobject);
$client = new SoapClient(API_ENDPOINT);
$response = $client->describeVehicle($buildrequest);

希望这对于那些经常使用肥皂 API 的人来说是显而易见的。

【问题讨论】:

    标签: php xml api soap soap-client


    【解决方案1】:

    螺丝SoapClient,使用curl。希望它对你有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-07-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-12
      • 1970-01-01
      • 2019-09-02
      相关资源
      最近更新 更多