Skip to content

Commit

Permalink
Fixes #11332: Allow tests to run on PHP 5.3
Browse files Browse the repository at this point in the history
Since PHP 5.3 the SoapClient requires a Content-Length header to be present.

According to http://bugs.php.net/bug.php?id=49226 :

  SOAP retrieves the WSDL using HTTP/1.0, which does not have chunked
  transfers. Therefore, the server should provide a Content-length header.
  If it does not do that, SoapServer can not load the WSDL correctly. This
  is not a bug in PHP, since the content-length header is mandatory for
  HTTP/1.0 messages which have a body.

This commit patches nusoap to send a Content-Length header for the WSDL file.
  • Loading branch information
rombert committed Jan 6, 2010
1 parent b50a52a commit 317f809
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/nusoap/nusoap.php
Expand Up @@ -3668,8 +3668,10 @@ function service($data){
fpassthru($fp);
}
} elseif ($this->wsdl) {
header("Content-Type: text/xml; charset=ISO-8859-1\r\n");
print $this->wsdl->serialize($this->debug_flag);
header("Content-Type: text/xml; charset=ISO-8859-1");
$output = $this->wsdl->serialize($this->debug_flag);
header("Content-Length: " . strlen($output) . "\r\n");
print $output;
if ($this->debug_flag) {
$this->debug('wsdl:');
$this->appendDebug($this->varDump($this->wsdl));
Expand Down

0 comments on commit 317f809

Please sign in to comment.