diff --git a/src/BeSimple/SoapServer/SoapResponse.php b/src/BeSimple/SoapServer/SoapResponse.php index 01789b8..eba70ff 100644 --- a/src/BeSimple/SoapServer/SoapResponse.php +++ b/src/BeSimple/SoapServer/SoapResponse.php @@ -51,19 +51,9 @@ class SoapResponse extends CommonSoapResponse public function send() { // set Content-Type header - header('Content-Type: ' . $this->getContentType()); - // get content to send - $response = $this->getContent(); + header('Content-Type: '.$this->getContentType()); - // set Content-Length header - if (function_exists('mb_strlen')) { - $length = mb_strlen($response, '8bit'); - } else { - $length = strlen($response); - } - header('Content-Length: ' . $length); - - // send response to client - echo $response; + // send content to client + echo $this->getContent(); } } diff --git a/src/BeSimple/SoapServer/SoapServer.php b/src/BeSimple/SoapServer/SoapServer.php index 9667df6..9b1deed 100644 --- a/src/BeSimple/SoapServer/SoapServer.php +++ b/src/BeSimple/SoapServer/SoapServer.php @@ -100,6 +100,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,