致命错误:未捕获的SoapFault异常:[SOAP-ENV:Client]错误找不到参数且无法连接到SoapClient

时间:2014-07-16 13:23:16

标签: php web-services soap wsdl

我是Web服务的新手,可能在某处犯了小错误。我正在尝试连接并使用带有PHP和SoapClient的WebService并收到以下错误:

Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] Error cannot find parameter in /www/1/html/webservices/tuev-nord-ass/soapclientconnect.php

WSDL链接:

http://www.schwackenet.de/awonline/de/service2/SNWebService.php?wsdl

我的代码:

<?php
ini_set("soap.wsdl_cache_enabled", "0");
ini_set('soap.wsdl_cache_ttl', '0');

$wsdl = 'http://www.schwackenet.de/awonline/de/service2/SNWebService.php?wsdl';

$options = array('trace' => true);
$client = new SoapClient($wsdl, 
array( 
'user' =>               'tülsenbeck',
'password' =>           'tülsenbeck',
'corporate_group_id' => '101',
'dealer_number' =>      'INT31303',
'dms_id' =>             'A13T2D19',
'dms_image_url' =>      '', 
'dms_keepalive_url' =>  '', 
'dms_followup_url' =>   '',
)
);
//Returns list of available SOAP functions described in the WSDL for the Web service. 
var_dump($client->__getFunctions());
//some parameters to send
$result = $client>Login('user','password','corporate_group_id','dealer_number','dms_id','dms_image_url','dms_keepalive_url','dms_followup_url');
var_dump($result);
?>

1 个答案:

答案 0 :(得分:1)

你完全弄乱了函数参数。

$options = array('trace' => true);
$params = array(
  'user' =>               'deshmukh',
  'password' =>           'deshmukh',
  'corporate_group_id' => '101',
  'dealer_number' =>      'INT31303',
  'dms_id' =>             'A13T2D19',
  'dms_image_url' =>      '', 
  'dms_keepalive_url' =>  '', 
  'dms_followup_url' =>   ''  
);

$client = new SoapClient($wsdl, $options);      // options!!!
$result = $client->Login($params);              // params!!!

现在回复“Zugangsdaten sindnichtgültig”,我想你会更进一步。

MFG