5 Commits

8 changed files with 25 additions and 28 deletions

View File

@ -158,7 +158,7 @@ class Curl
$location
);
if (!is_integer($httpResponseCode) || $httpResponseCode >= 400) {
if (!is_integer($httpResponseCode) || $httpResponseCode >= 400 || $httpResponseCode === 0) {
return new CurlResponse(
$httpRequestHeadersAsString,

View File

@ -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()
{

View File

@ -71,7 +71,7 @@ class MimeFilter implements SoapRequestFilter, SoapResponseFilter
$soapPart = $multiPartMessage->getMainPart();
$attachments = $multiPartMessage->getAttachments();
$response->setContent($this->sanitizePhpExceptionOnHrefs($soapPart));
$response->setContent($soapPart->getContent());
$response->setContentType($soapPart->getHeader('Content-Type'));
if (count($attachments) > 0) {
$response->setAttachments($attachments);

View File

@ -6,10 +6,10 @@ use BeSimple\SoapCommon\SoapResponse as CommonSoapResponse;
class SoapResponse extends CommonSoapResponse
{
/**
* @var mixed
*/
/** @var mixed */
protected $responseObject;
/** @var SoapResponseTracingData */
protected $tracingData;
public function getResponseContent()
{
@ -25,4 +25,19 @@ class SoapResponse extends CommonSoapResponse
{
$this->responseObject = $responseObject;
}
public function hasTracingData()
{
return $this->tracingData !== null;
}
public function getTracingData()
{
return $this->tracingData;
}
public function setTracingData(SoapResponseTracingData $tracingData)
{
$this->tracingData = $tracingData;
}
}

View File

@ -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);

View File

@ -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(

View File

@ -13,8 +13,6 @@
namespace BeSimple\SoapCommon;
use BeSimple\SoapClient\SoapResponseTracingData;
/**
* SOAP response message.
*
@ -23,21 +21,4 @@ use BeSimple\SoapClient\SoapResponseTracingData;
*/
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;
}
}

View File

@ -38,7 +38,7 @@ class MimeFilter implements SoapRequestFilter, SoapResponseFilter
$soapPart = $multiPartMessage->getMainPart();
$attachments = $multiPartMessage->getAttachments();
$request->setContent($this->sanitizePhpExceptionOnHrefs($soapPart));
$request->setContent($soapPart->getContent());
$request->setContentType($soapPart->getHeader('Content-Type'));
if (count($attachments) > 0) {
$request->setAttachments($attachments);