Merge branch '0.1'

Conflicts:
	src/BeSimple/SoapServer/SoapResponse.php
This commit is contained in:
Francis Besset 2013-11-06 16:50:31 +01:00
commit 10705aa9e2
2 changed files with 7 additions and 13 deletions

View File

@ -52,18 +52,8 @@ class SoapResponse extends CommonSoapResponse
{ {
// set Content-Type header // set Content-Type header
header('Content-Type: '.$this->getContentType()); header('Content-Type: '.$this->getContentType());
// get content to send
$response = $this->getContent();
// set Content-Length header // send content to client
if (function_exists('mb_strlen')) { echo $this->getContent();
$length = mb_strlen($response, '8bit');
} else {
$length = strlen($response);
}
header('Content-Length: ' . $length);
// send response to client
echo $response;
} }
} }

View File

@ -100,6 +100,10 @@ class SoapServer extends \SoapServer
parent::handle($soapRequest->getContent()); parent::handle($soapRequest->getContent());
$response = ob_get_clean(); $response = ob_get_clean();
// Remove headers added by SoapServer::handle() method
header_remove('Content-Length');
header_remove('Content-Type');
// wrap response data in SoapResponse object // wrap response data in SoapResponse object
$soapResponse = SoapResponse::create( $soapResponse = SoapResponse::create(
$response, $response,