cause of a nasty "couldn't build response" error
| From: | (Jonathan Schilling) | Date: | Tue, 18 Mar 2003 18:51:00 +0000 |
| Subject: | cause of a nasty "couldn't build response" error | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-473@lists.php.net to get a copy of this message | ||
If you're trying to do PEAR::SOAP over HTTPS/SSL (with or without
certificates), and you get a SOAP fault like this:
soap_fault Object
(
[error_message_prefix] =>
[mode] => 1
[level] => 1024
[code] => Parser
[message] => couldn't build response
[userinfo] =>
[callback] =>
)
and setting on curl verbosity shows you the curl_exec call is
failing, and you instrument SOAP/Transport/HTTP.php to print out
curl_errno and curl_error, and they show something like this ...
* Closing connection #0
error is
18 transfer closed with -3 bytes remaining to read end-of-error
What is happening is that you have trailing spaces after the
closing ?> in your PEAR::SOAP service PHP file. Those extra spaces
don't cause any problem during a normal http SOAP call, but when
using https, they cause the above failure.
I don't know whether this is a bug or a feature, but I wanted to
post it for posterity.
Jonathan Schilling Caldera/SCO jls@sco.com