【问题标题】:PHP-EWS Error: Couldn't bind to servicePHP-EWS 错误:无法绑定到服务
【发布时间】:2012-10-12 10:48:56
【问题描述】:

当我尝试使用 php-ews 进行任何调用时,我收到“SOAP-ERROR: Parsing WSDL: Couldn't bind to service in”。我已将我的 Exchange 实例中的 services.wsdl、messages.xsd 和 types.xsd 文件复制到我的本地 ews/wsdl 目录中,并且在其中明确定义了服务,并且我使用的是正确的版本 (ExchangeWebServices::VERSION_2007_SP1 )。有什么想法吗?

【问题讨论】:

  • 一件事是每当使用 WSDL 调试 SOAP 时都会关闭缓存。 ini_set("soap.wsdl_cache_enabled", 0); 你能发布 WSDL,特别是 definitions 部分吗?错误信息很清楚。
  • @ficuscr 感谢您提供有关缓存的提示,我确保它已关闭。 WSDL 超过 1K 行,所以这里有一个链接。 pastebin.com/aXEeL0XT
  • 嗯,有 https 吗?也许看看 SoapClient 的 local_cert 参数。我的意思是对错误的一般回答是:“您需要定义WSDL 的服务元素”...我首先在浏览器中查看 WSDL 并尝试点击进入 URI。希望你会发现这不是不能解决的。尝试过任何验证器?抱歉,我无法提供更多帮助。

标签: php soap exchangewebservices


【解决方案1】:

由于您已从 Exchange 服务器下载 services.wsdl,因此您必须对其进行修改。

在结束标记(wsdl:definitions)之前添加:

    ...
    <wsdl:service name="ExchangeServices">
      <wsdl:port name="ExchangeServicePort" binding="tns:ExchangeServiceBinding">
        <soap:address location="https://path.to.your.exchange.server/EWS/Exchange.asmx" />
      </wsdl:port>
    </wsdl:service> 

</wsdl:definitions> 

【讨论】:

  • 天才。这应该是答案。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多