【问题标题】:php-ews-master / response errorphp-ews-master / 响应错误
【发布时间】:2014-01-26 21:35:09
【问题描述】:

我正在尝试使用 php-ews-master 连接到 Exchange 服务器,但我一直在苦苦挣扎。

使用 CURL_HTTP_VERSION_1_1 我收到了错误:

  • 分块编码数据中的问题 (3)。

如果我修改为 CURL_HTTP_VERSION_1_0 我收到了来自服务器的响应,但响应中有很多添加的字符(我想这些是因为分块响应???),因此它不是一个有效的 xml 文件。

我正在尝试使用的代码:

$headers = array(
 'Method: POST',
 'Connection: Keep-Alive',
 'User-Agent: PHP-SOAP-CURL',
 'Content-Type: text/xml; charset=utf-8',
 'SOAPAction: "'.$action.'"',
 );
$this->ch = curl_init($location);
curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, $this->validate);
curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, $this->validate);
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($this->ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($this->ch, CURLOPT_POST, true );
curl_setopt($this->ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($this->ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($this->ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
curl_setopt($this->ch, CURLOPT_USERPWD, $this->user.':'.$this->password);*

$response = curl_exec($this->ch);

感谢您的帮助。

【问题讨论】:

    标签: php curl libcurl soap-client


    【解决方案1】:

    我找到了解决方案。 如果有人遇到同样的问题,只需添加这一行:

    curl_setopt($this->ch, CURLOPT_SSLVERSION, 3);

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-27
      • 2021-07-14
      • 2017-10-04
      • 2014-07-24
      • 1970-01-01
      相关资源
      最近更新 更多