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 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制