Example #1
0
 private function getClientSoap($typo)
 {
     $local_wsdl = $this->wsdl["{$typo}"];
     $local_end_point = $this->end_point . TODOPAGO_ENDPOINT_SOAP_APPEND . TODOPAGO_ENDPOINT_TENATN . "{$typo}";
     $context = array('http' => array('header' => $this->header_http), 'ssl' => array('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true));
     // Fix bug #49853 - https://bugs.php.net/bug.php?id=49853
     if (version_compare(PHP_VERSION, '5.3.10') == -1) {
         $clientSoap = new Client($local_wsdl, array('local_cert' => $this->local_cert, 'connection_timeout' => $this->connection_timeout, 'location' => $local_end_point, 'encoding' => 'UTF-8', 'proxy_host' => $this->host, 'proxy_port' => $this->port, 'proxy_login' => $this->user, 'proxy_password' => $this->pass));
         $clientSoap->setCustomHeaders($context);
         return $clientSoap;
     }
     $clientSoap = new \SoapClient($local_wsdl, array('stream_context' => stream_context_create($context), 'local_cert' => $this->local_cert, 'connection_timeout' => $this->connection_timeout, 'location' => $local_end_point, 'encoding' => 'UTF-8', 'proxy_host' => $this->host, 'proxy_port' => $this->port, 'proxy_login' => $this->user, 'proxy_password' => $this->pass));
     return $clientSoap;
 }