diff --git a/src/BeSimple/SoapServer/SoapRequest.php b/src/BeSimple/SoapServer/SoapRequest.php index 8a03d7a..427673f 100644 --- a/src/BeSimple/SoapServer/SoapRequest.php +++ b/src/BeSimple/SoapServer/SoapRequest.php @@ -32,10 +32,21 @@ class SoapRequest extends CommonSoapRequest */ public static function create($content, $version) { - $content = is_null($content) ? file_get_contents("php://input") : $content; $location = self::getCurrentUrl(); - $action = $_SERVER[SoapMessage::SOAP_ACTION_HEADER]; - $contentType = $_SERVER[SoapMessage::CONTENT_TYPE_HEADER]; + /* + * Work around missing header/php://input access in PHP cli webserver by + * setting headers additionally as GET parameters and SOAP request body + * explicitly as POST variable + */ + if (php_sapi_name() == "cli-server") { + $content = is_null($content) ? $_POST['request'] : $content; + $action = $_GET[SoapMessage::SOAP_ACTION_HEADER]; + $contentType = $_GET[SoapMessage::CONTENT_TYPE_HEADER]; + } else { + $content = is_null($content) ? file_get_contents("php://input") : $content; + $action = $_SERVER[SoapMessage::SOAP_ACTION_HEADER]; + $contentType = $_SERVER[SoapMessage::CONTENT_TYPE_HEADER]; + } $request = new SoapRequest(); // $content is if unmodified from SoapClient not a php string type!