[SoapServer] Removed headers added by SoapServer::handle() method

This commit is contained in:
Francis Besset 2013-11-06 16:48:44 +01:00
parent e9429a5d03
commit 7fa666e9de
2 changed files with 10 additions and 9 deletions

View File

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

View File

@ -95,6 +95,10 @@ class SoapServer extends \SoapServer
parent::handle($soapRequest->getContent());
$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
$soapResponse = SoapResponse::create(
$response,