--TEST-- Bug #47021 SoapClient (SoapClient stumbles over WSDL delivered with "Transfer-Encoding: chunked") --INI-- soap.wsdl_cache_enabled=0 --EXTENSIONS-- soap --SKIPIF-- $v) { $chunks[$k] = sprintf("%08x\r\n%s\r\n", strlen($v), $v); } return join('', $chunks); } $wsdl = file_get_contents(__DIR__.'/server030.wsdl'); $soap = << text0text1text2text3text4text5text6text7text8text9 EOF; $responses = [ "data://text/plain,HTTP/1.1 200 OK\r\n". "Content-Type: text/xml;charset=utf-8\r\n". "Transfer-Encoding: \t chunked\t \r\n". "Connection: close\r\n". "\r\n". chunk_body($wsdl, 64), "data://text/plain,HTTP/1.1 200 OK\r\n". "Content-Type: text/xml;charset=utf-8\r\n". "Transfer-Encoding: \t chunked\t \r\n". "Connection: close\r\n". "\r\n". chunk_body($soap, 156), ]; ['pid' => $pid, 'uri' => $uri] = http_server($responses); $options = [ 'trace' => true, 'location' => $uri, ]; class BugSoapClient extends SoapClient { public function __doRequest($request, $location, $action, $version, $one_way = null): ?string { $response = parent::__doRequest($request, $location, $action, $version, $one_way); var_dump(strlen($response)); return $response; } } $client = new BugSoapClient($uri, $options); var_dump(count($client->getItems())); http_server_kill($pid); --EXPECT-- int(1291) int(10)