duanaidang6197 2010-07-27 01:38
浏览 55
已采纳

PHP SOAP /理解WSDL

Figured it out, see Update below.

I'm trying to work with a particular web service via PHP (tried both the native and Zend SOAP clients) and it only returns a failure status.

I suspect that it has something to do with the multiple beans in the retrieveMemberInfo method call (authBean, memberInfoBean).

Could someone take a look at the WSDL and point me in the right direction for this particular method call via the PHP client?

Here is what I have so far:

$service = new SoapClient('https://qa.everbridge.net/ws3/services/WebServices3?wsdl');
$result = $service->retrieveMemberInfo(array('loginId', 'orgName', 'password'), array('firstname', 'lastname'));
var_dump($result);

Update

The problem was not with the WSDL call as originally thought. It was the format for the parameters used in the retrieveMemberInfo method call. Here is the full solution that correctly returns the SOAP response:

$params->authBean->loginId = 'username';
$params->authBean->orgName = 'orgName';
$params->authBean->password = 'password';
$params->memberInfoBean->firstName = 'firstName';
$params->memberInfoBean->lastName = 'lastName';

$service = new SoapClient('https://qa.everbridge.net/ws3/services/WebServices3?wsdl');
$result = $service->retrieveMemberInfo($params);

var_dump($result);

Now I just have to figure out how to parse the returned stdObject.

Thanks for the assistance.

  • 写回答

3条回答 默认 最新

  • dongqiao8417 2010-07-27 04:44
    关注

    This is apparently a bug in PHP. The file is not completely read. There's nothing wrong with the WSDL itself.

    The XML parsing error is this:

    object(LibXMLError)#1 (6) {
      ["level"]=>
      int(3)
      ["code"]=>
      int(5)
      ["column"]=>
      int(5)
      ["message"]=>
      string(41) "Extra content at the end of the document
    "
      ["file"]=>
      string(56) "https://qa.everbridge.net/ws3/services/WebServices3?wsdl"
      ["line"]=>
      int(537)
    }
    

    Line 537 is quite before the end of the file.

    I suggest you report this to http://bugs.php.net/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)
  • ¥20 matlab yalmip kkt 双层优化问题
  • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体
  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多