I'm trying to use php-ews-master to connect to exchange server, and I'm struggling from a while.
With CURL_HTTP_VERSION_1_1 I'm getting the error :
- Problem (3) in the Chunked-Encoded data.
If I modify to CURL_HTTP_VERSION_1_0 I got a response from the server but the response has a lot of added characters (I suppose these are because the chunked response???) and for this reason it's not a valid xml file.
The code I'm trying to use :
$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);
Thanks for help.