src/Soap/Client.php
public function __doRequest($request, $location, $action, $version, $one_way = null)
    {
        $response = "";
        for ($attempt = 0; $attempt < $this->persistanceFactor; $attempt++) {
            $ch = curl_init($location);
            curl_setopt($ch, CURLOPT_HEADER, false);
            if ($one_way !== true) {
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            }
            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
            curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->negotiationTimeout);
            curl_setopt($ch, CURLOPT_TIMEOUT, $this->persistanceTimeout);
            $headersFormatted = $this->buildHeaders($version);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headersFormatted);
            if ($this->getIgnoreCertVerify() === true) {
                curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
            } else {
                curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
            }
            if ($this->auth === true) {
                $credentials = $this->authLogin;
                $credentials .= ($this->authPassword !== null) ? ":" . $this->authPassword : "";
                curl_setopt($ch, CURLOPT_USERPWD, $credentials);
            }
            $response = curl_exec($ch);
            $this->lastConnErrNo = curl_errno($ch);
            curl_close($ch);
            if (($this->lastConnErrNo === 0) && ($response !== false)) {
                break;
            }

            if ($attempt >= $this->persistanceFactor - 1) {
                $message = 'Request failed for the maximum number of attempts.';
                if($this->lastConnErrNo !== 0 && ($getErrorMessage = $this->getLastConnErrText())) {
                    $message = $getErrorMessage;
                }
                throw new Exception($message);
            }
        }
        return $response;
    }
public function __doRequest($request, $location, $action, $version, $one_way = null)
    {
        $response = "";
        for ($attempt = 0; $attempt < $this->persistanceFactor; $attempt++) {
            $ch = curl_init($location);
            curl_setopt($ch, CURLOPT_HEADER, false);
            if ($one_way !== true) {
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            }
            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
            curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->negotiationTimeout);
            curl_setopt($ch, CURLOPT_TIMEOUT, $this->persistanceTimeout);
            $headersFormatted = $this->buildHeaders($version);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headersFormatted);
            if ($this->getIgnoreCertVerify() === true) {
                curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
            } else {
                curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
            }
            if ($this->auth === true) {
                $credentials = $this->authLogin;
                $credentials .= ($this->authPassword !== null) ? ":" . $this->authPassword : "";
                curl_setopt($ch, CURLOPT_USERPWD, $credentials);
            }
            $response = curl_exec($ch);
            $this->lastConnErrNo = curl_errno($ch);
            curl_close($ch);
            if (($this->lastConnErrNo === 0) && ($response !== false)) {
                break;
            }

            if ($attempt >= $this->persistanceFactor - 1) {
                $message = 'Request failed for the maximum number of attempts.';
                if($this->lastConnErrNo !== 0 && ($getErrorMessage = $this->getLastConnErrText())) {
                    $message = $getErrorMessage;
                }
                throw new Exception($message);
            }
        }
        return $response;
    }
Performs the request using cUrl, should not be called directly, but through
normal usage of PHP SoapClient (using particular methods of the WebService).
Throws an exception if connection or data read fails more than the number of retries (persistanceFactor).
Returns data response / content.

@param string $request Request (XML/Data) to be sent to the WebService parsed by SoapClient.
@param string $location WebService URL.
@param string $action Currently not used. In the signature for compatibility with SoapClient. TODO: to be used with particular soap versions.
@param int $version Currently not used. In the signature for compatibility with SoapClient. TODO: add Soap Version selection.
@param bool $one_way Currently not used. In the signature for compatibility with SoapClient.
@return mixed
@throws Exception