Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
cf6e147c26 | |||
f276a30a47 | |||
4edc46e67f | |||
a76526a5b6 | |||
baf32c1350 | |||
5c0bf914e3 |
@ -62,7 +62,7 @@ class Curl
|
||||
curl_setopt_array($curlSession, [
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_SSL_VERIFYPEER => false,
|
||||
CURLOPT_FAILONERROR => true,
|
||||
CURLOPT_FAILONERROR => false,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_HEADER => true,
|
||||
@ -147,6 +147,8 @@ class Curl
|
||||
$headerSize = curl_getinfo($curlSession, CURLINFO_HEADER_SIZE);
|
||||
$httpResponseCode = curl_getinfo($curlSession, CURLINFO_HTTP_CODE);
|
||||
$httpResponseContentType = curl_getinfo($curlSession, CURLINFO_CONTENT_TYPE);;
|
||||
$responseBody = substr($executeSoapCallResponse, $headerSize);
|
||||
$responseHeaders = substr($executeSoapCallResponse, 0, $headerSize);
|
||||
preg_match('/HTTP\/(1\.[0-1]+) ([0-9]{3}) (.*)/', $executeSoapCallResponse, $httpResponseMessages);
|
||||
$httpResponseMessage = trim(array_pop($httpResponseMessages));
|
||||
$curlErrorMessage = sprintf(
|
||||
@ -156,7 +158,7 @@ class Curl
|
||||
$location
|
||||
);
|
||||
|
||||
if ($executeSoapCallResponse === false) {
|
||||
if (!is_integer($httpResponseCode) || $httpResponseCode >= 400 || $httpResponseCode === 0) {
|
||||
|
||||
return new CurlResponse(
|
||||
$httpRequestHeadersAsString,
|
||||
@ -164,6 +166,8 @@ class Curl
|
||||
$httpResponseMessage,
|
||||
$httpResponseContentType,
|
||||
self::CURL_FAILED,
|
||||
$responseHeaders,
|
||||
$responseBody,
|
||||
$curlErrorMessage
|
||||
);
|
||||
}
|
||||
@ -174,9 +178,8 @@ class Curl
|
||||
$httpResponseMessage,
|
||||
$httpResponseContentType,
|
||||
self::CURL_SUCCESS,
|
||||
null,
|
||||
substr($executeSoapCallResponse, 0, $headerSize),
|
||||
substr($executeSoapCallResponse, $headerSize)
|
||||
$responseHeaders,
|
||||
$responseBody
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ use Exception;
|
||||
class CurlOptionsBuilder
|
||||
{
|
||||
const DEFAULT_MAX_REDIRECTS = 10;
|
||||
const DEFAULT_CONNECTION_TIMEOUT = 10;
|
||||
const DEFAULT_CONNECTION_TIMEOUT = 120;
|
||||
|
||||
public static function buildDefault()
|
||||
{
|
||||
|
@ -19,9 +19,9 @@ class CurlResponse
|
||||
$httpResponseStatusMessage,
|
||||
$httpResponseContentType,
|
||||
$curlStatus,
|
||||
$curlErrorMessage = null,
|
||||
$responseHeader = null,
|
||||
$responseBody = null
|
||||
$responseHeader,
|
||||
$responseBody,
|
||||
$curlErrorMessage = null
|
||||
) {
|
||||
$this->httpRequestHeaders = $httpRequestHeaders;
|
||||
$this->httpResponseStatusCode = $httpResponseStatusCode;
|
||||
@ -78,21 +78,11 @@ class CurlResponse
|
||||
return $this->curlErrorMessage;
|
||||
}
|
||||
|
||||
public function hasResponseHeader()
|
||||
{
|
||||
return $this->responseHeader !== null;
|
||||
}
|
||||
|
||||
public function getResponseHeader()
|
||||
{
|
||||
return $this->responseHeader;
|
||||
}
|
||||
|
||||
public function hasResponseBody()
|
||||
{
|
||||
return $this->responseBody !== null;
|
||||
}
|
||||
|
||||
public function getResponseBody()
|
||||
{
|
||||
return $this->responseBody;
|
||||
|
@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace BeSimple\SoapClient;
|
||||
|
||||
class SoapClientNativeDataTransferObject
|
||||
{
|
||||
public $request;
|
||||
public $location;
|
||||
public $action;
|
||||
public $version;
|
||||
|
||||
public function __construct($request, $location, $action, $version)
|
||||
{
|
||||
$this->request = $request;
|
||||
$this->location = $location;
|
||||
$this->action = $action;
|
||||
$this->version = $version;
|
||||
}
|
||||
}
|
@ -75,7 +75,7 @@ class WsdlDownloader
|
||||
$curlResponse = $curl->executeCurlWithCachedSession($wsdlPath);
|
||||
if ($curlResponse->curlStatusSuccess()) {
|
||||
if (mb_strlen($curlResponse->getResponseBody()) === 0) {
|
||||
throw new Exception('Could not write WSDL cache file: curl response empty');
|
||||
throw new Exception('Could not write WSDL cache file: empty curl response from: '.$wsdlPath);
|
||||
}
|
||||
if ($resolveRemoteIncludes === true) {
|
||||
$document = $this->getXmlFileDOMDocument($curl, $cacheType, $curlResponse->getResponseBody(), $wsdlPath);
|
||||
|
@ -110,7 +110,8 @@ class Parser
|
||||
}
|
||||
if (strpos($currentHeader, ':') !== false) {
|
||||
list($headerName, $headerValue) = explode(':', $currentHeader, 2);
|
||||
$headerValue = iconv_mime_decode($headerValue, 0, Part::CHARSET_UTF8);
|
||||
$headerValueWithNoCrAtTheEnd = trim($headerValue);
|
||||
$headerValue = iconv_mime_decode($headerValueWithNoCrAtTheEnd, 0, Part::CHARSET_UTF8);
|
||||
$parsedMimeHeaders = ContentTypeParser::parseContentTypeHeader($headerName, $headerValue);
|
||||
foreach ($parsedMimeHeaders as $parsedMimeHeader) {
|
||||
$currentPart->setHeader(
|
||||
|
Reference in New Issue
Block a user