douzhuang2016 2014-07-16 11:46
浏览 59
已采纳

使用SoapClient PHP无法连接

I am trying to connect and use a WebService with PHP and SoapClient, but getting the following error

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

I have SOAP already installed. But still dont know why i am getting this error. I am new to web services and might be doing mistake somewhere.

WSDL link:

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

My code:

<?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( 
'Benutzer' =>           'desenbeck',
'Kennwort' =>           'desenbeck',
'KonzernID' =>          '100',
'Händler-Nr' =>         'INT31303',
'DMS-ID' =>             'A13T2D19',
'encoding'=>            'ISO-8859-1'
)
);
//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('Benutzer', 'Kennwort', 'KonzernID', 'Händler-Nr', 'DMS-ID');
var_dump($result);
?>
  • 写回答

1条回答 默认 最新

  • douyuben9434 2014-07-17 06:12
    关注

    Use a string indexed array for parameter:

    $param = array ('user' => 'test',
        'password' => 'test',
        'corporate_group_id' => 'test',
        'dealer_number' => 'test',
        'dms_id' => 'test',
        'dms_image_url' => 'test',
        'dms_keepalive_url' => 'test',
        'dms_followup_url' => 'test');
    
    //some parameters to send
    $result = $client->Login($param);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 centos7中sudo命令无法使用
  • ¥15 灰狼算法和蚁群算法如何结合
  • ¥15 这是一个利用ESP32自带按键和LED控制的录像代码,编译过程出现问题,请解决并且指出错误,指导如何处理 ,协助完成代码并上传代码
  • ¥20 stm32f103,hal库 hal_usart_receive函数接收不到数据。
  • ¥20 求结果和代码,sas利用OPTEX程序和D-efficiency生成正交集
  • ¥50 求fpga交通信号灯设计Verilog代码
  • ¥50 adb连接不到手机是怎么回事?
  • ¥20 抓取数据时发生错误: get_mooncake_data() missing 1 required positional argument: 'driver'的问题,怎么改出正确的爬虫代码?
  • ¥15 vs2022无法联网
  • ¥15 TCP的客户端和服务器的互联