Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
0e2c33faf8 | |||
cf6e147c26 | |||
f276a30a47 | |||
4edc46e67f | |||
a76526a5b6 |
@ -158,7 +158,7 @@ class Curl
|
|||||||
$location
|
$location
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!is_integer($httpResponseCode) || $httpResponseCode >= 400) {
|
if (!is_integer($httpResponseCode) || $httpResponseCode >= 400 || $httpResponseCode === 0) {
|
||||||
|
|
||||||
return new CurlResponse(
|
return new CurlResponse(
|
||||||
$httpRequestHeadersAsString,
|
$httpRequestHeadersAsString,
|
||||||
|
@ -13,7 +13,7 @@ use Exception;
|
|||||||
class CurlOptionsBuilder
|
class CurlOptionsBuilder
|
||||||
{
|
{
|
||||||
const DEFAULT_MAX_REDIRECTS = 10;
|
const DEFAULT_MAX_REDIRECTS = 10;
|
||||||
const DEFAULT_CONNECTION_TIMEOUT = 10;
|
const DEFAULT_CONNECTION_TIMEOUT = 120;
|
||||||
|
|
||||||
public static function buildDefault()
|
public static function buildDefault()
|
||||||
{
|
{
|
||||||
|
@ -71,7 +71,7 @@ class MimeFilter implements SoapRequestFilter, SoapResponseFilter
|
|||||||
$soapPart = $multiPartMessage->getMainPart();
|
$soapPart = $multiPartMessage->getMainPart();
|
||||||
$attachments = $multiPartMessage->getAttachments();
|
$attachments = $multiPartMessage->getAttachments();
|
||||||
|
|
||||||
$response->setContent($this->sanitizePhpExceptionOnHrefs($soapPart));
|
$response->setContent($soapPart->getContent());
|
||||||
$response->setContentType($soapPart->getHeader('Content-Type'));
|
$response->setContentType($soapPart->getHeader('Content-Type'));
|
||||||
if (count($attachments) > 0) {
|
if (count($attachments) > 0) {
|
||||||
$response->setAttachments($attachments);
|
$response->setAttachments($attachments);
|
||||||
|
@ -6,10 +6,10 @@ use BeSimple\SoapCommon\SoapResponse as CommonSoapResponse;
|
|||||||
|
|
||||||
class SoapResponse extends CommonSoapResponse
|
class SoapResponse extends CommonSoapResponse
|
||||||
{
|
{
|
||||||
/**
|
/** @var mixed */
|
||||||
* @var mixed
|
|
||||||
*/
|
|
||||||
protected $responseObject;
|
protected $responseObject;
|
||||||
|
/** @var SoapResponseTracingData */
|
||||||
|
protected $tracingData;
|
||||||
|
|
||||||
public function getResponseContent()
|
public function getResponseContent()
|
||||||
{
|
{
|
||||||
@ -25,4 +25,19 @@ class SoapResponse extends CommonSoapResponse
|
|||||||
{
|
{
|
||||||
$this->responseObject = $responseObject;
|
$this->responseObject = $responseObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function hasTracingData()
|
||||||
|
{
|
||||||
|
return $this->tracingData !== null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTracingData()
|
||||||
|
{
|
||||||
|
return $this->tracingData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setTracingData(SoapResponseTracingData $tracingData)
|
||||||
|
{
|
||||||
|
$this->tracingData = $tracingData;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ class WsdlDownloader
|
|||||||
$curlResponse = $curl->executeCurlWithCachedSession($wsdlPath);
|
$curlResponse = $curl->executeCurlWithCachedSession($wsdlPath);
|
||||||
if ($curlResponse->curlStatusSuccess()) {
|
if ($curlResponse->curlStatusSuccess()) {
|
||||||
if (mb_strlen($curlResponse->getResponseBody()) === 0) {
|
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) {
|
if ($resolveRemoteIncludes === true) {
|
||||||
$document = $this->getXmlFileDOMDocument($curl, $cacheType, $curlResponse->getResponseBody(), $wsdlPath);
|
$document = $this->getXmlFileDOMDocument($curl, $cacheType, $curlResponse->getResponseBody(), $wsdlPath);
|
||||||
|
@ -110,7 +110,8 @@ class Parser
|
|||||||
}
|
}
|
||||||
if (strpos($currentHeader, ':') !== false) {
|
if (strpos($currentHeader, ':') !== false) {
|
||||||
list($headerName, $headerValue) = explode(':', $currentHeader, 2);
|
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);
|
$parsedMimeHeaders = ContentTypeParser::parseContentTypeHeader($headerName, $headerValue);
|
||||||
foreach ($parsedMimeHeaders as $parsedMimeHeader) {
|
foreach ($parsedMimeHeaders as $parsedMimeHeader) {
|
||||||
$currentPart->setHeader(
|
$currentPart->setHeader(
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
|
|
||||||
namespace BeSimple\SoapCommon;
|
namespace BeSimple\SoapCommon;
|
||||||
|
|
||||||
use BeSimple\SoapClient\SoapResponseTracingData;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SOAP response message.
|
* SOAP response message.
|
||||||
*
|
*
|
||||||
@ -23,21 +21,4 @@ use BeSimple\SoapClient\SoapResponseTracingData;
|
|||||||
*/
|
*/
|
||||||
class SoapResponse extends SoapMessage
|
class SoapResponse extends SoapMessage
|
||||||
{
|
{
|
||||||
/** @var SoapResponseTracingData */
|
|
||||||
protected $tracingData;
|
|
||||||
|
|
||||||
public function hasTracingData()
|
|
||||||
{
|
|
||||||
return $this->tracingData !== null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTracingData()
|
|
||||||
{
|
|
||||||
return $this->tracingData;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setTracingData(SoapResponseTracingData $tracingData)
|
|
||||||
{
|
|
||||||
$this->tracingData = $tracingData;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ class MimeFilter implements SoapRequestFilter, SoapResponseFilter
|
|||||||
$soapPart = $multiPartMessage->getMainPart();
|
$soapPart = $multiPartMessage->getMainPart();
|
||||||
$attachments = $multiPartMessage->getAttachments();
|
$attachments = $multiPartMessage->getAttachments();
|
||||||
|
|
||||||
$request->setContent($this->sanitizePhpExceptionOnHrefs($soapPart));
|
$request->setContent($soapPart->getContent());
|
||||||
$request->setContentType($soapPart->getHeader('Content-Type'));
|
$request->setContentType($soapPart->getHeader('Content-Type'));
|
||||||
if (count($attachments) > 0) {
|
if (count($attachments) > 0) {
|
||||||
$request->setAttachments($attachments);
|
$request->setAttachments($attachments);
|
||||||
|
Reference in New Issue
Block a user