Http.php is written to perform an HTTP POST using HTTP/1.1 which means that the Hessian client must support a HTTP header of "Transfer-Encoding: chunked".
Protocol::parseReply() is written as follows:
if($this->read(1) != 'r') {
return new HessianError('Hessian Parser, Malformed reply: expected r',HESSIAN_PARSER_ERROR,0,$this->stream);
}
which will fail because the first line of a chunked response will contain the chunk length. Protocol::parseReply() needs to be written to support chunking.
At the moment the workaround I have is to set HTTP/1.0 in Http::POST.
Example stack trace:
Fatal error: Uncaught exception 'HessianError' with message 'Hessian Parser, Malformed reply: expected r' in /opt/hessian-php/1.0.5-RC2/dist/Protocol.php:339
Stack trace:
#0 /opt/hessian-php/1.0.5-RC2/dist/HessianClient.php(214): HessianParser->parseReply()
#1 /opt/hessian-php/1.0.5-RC2/dist/Filter.php(159): HessianProxy->executeCall('getUserInfo', Array)
#2 /opt/hessian-php/1.0.5-RC2/dist/Filter.php(73): ProxyFilter->execute(Object(HessianProxy), Object(FilterChain))
#3 /opt/hessian-php/1.0.5-RC2/dist/Filter.php(191): FilterChain->doFilter(Object(HessianProxy))
#4 /opt/hessian-php/1.0.5-RC2/dist/Filter.php(73): PHPErrorReportingFilter->execute(Object(HessianProxy), Object(FilterChain))
#5 /opt/hessian-php/1.0.5-RC2/dist/HessianClient.php(182): FilterChain->doFilter(Object(HessianProxy))
#6 /opt/hessian-php/1.0.5-RC2/dist/HessianClient5.php(94): HessianProxy->call('getUserInfo', Array)
#7 [internal function]: HessianClient->__call('getUserInfo', Array)
I've also experienced this error. Thank you very much for posting this workaround.