public function __doRequest($request, $location, $action, $version, $one_way = 0) {

		$this->__last_request = $request;

		if(empty($this->headers)) {
			$headers = array( 'Connection: Close', 'Content-Type: application/soap+xml' );
		}
		else {
			$headers = $this->headers;
		}

		$soapHeaders = array(
			sprintf('SOAPAction: "%s"', $action),
			sprintf('Content-Length: %d', strlen($request))
		);

		$headers = array_merge($headers, $soapHeaders);

		$this->logger->debug('Request: '.$request, $headers);

		$ch = curl_init($location);

		$options = $this->curlOptions + array(
			CURLOPT_FOLLOWLOCATION => true,
			CURLOPT_SSL_VERIFYHOST => 2,
			CURLOPT_SSL_VERIFYPEER => true,
			CURLOPT_RETURNTRANSFER => true,
			CURLOPT_HTTPHEADER     => $headers,
			CURLOPT_POSTFIELDS     => $request
		);

		if($this->logger->isHandling(Logger::DEBUG)) {
			$tmp = fopen('php://temp', 'r+');
			$options[CURLOPT_VERBOSE] = true;
			$options[CURLOPT_STDERR]  = $tmp;
		}

		curl_setopt_array($ch, $options);

		$output = curl_exec($ch);

		if(isset($tmp) && is_resource($tmp)) {
			rewind($tmp);
			$this->logger->debug(stream_get_contents($tmp));
			fclose($tmp);
		}

		$this->logger->debug('Response: '.$output);

		return $output;
	}