protected function createClient($server, $auth, $options) { $location = 'https://' . $this->cleanServerUrl($server) . '/EWS/Exchange.asmx'; $options = array_replace_recursive(['version' => self::VERSION_2007, 'trace' => 1, 'exceptions' => true, 'classmap' => ClassMap::getClassMap(), 'drillDownResponses' => true], $options); $this->server = $server; $this->version = $options['version']; $backup = libxml_disable_entity_loader(false); $this->soap = new NTLMSoapClient($location, $auth, dirname(__FILE__) . '/../../Resources/wsdl/services.wsdl', $options); libxml_disable_entity_loader($backup); if (isset($options['primarySmtpEmailAddress'])) { $this->setPrimarySmtpEmailAddress($options['primarySmtpEmailAddress']); } if (isset($options['impersonation'])) { $this->setPrimarySmtpEmailAddress($options['impersonation']); } $this->drillDownResponses = $options['drillDownResponses']; }