Thursday, September 13, 2007

NuSOAP & PHP 5.2.2 problem

NuSOAP has problem with PHP 5.2.2. It won't work with this version of PHP.

At first, it didn't go into webservice's function.
So I fixed it according to this post.
http://www.jamesnetherton.com/blog/index.cfm/2007/6/6/HTTPRAWPOSTDATA-with-nusoap-on-PHP-522
HTTP_RAW_POST_DATA with nusoap on PHP 5.2.2

Posted by James Netherton | Wednesday 06 June 2007 1:02 PM | In PHP

I just fixed a weird issue where I had a Flex client invoking a PHP Nusoap SOAP web service.

Whenever the client was making requests to the PHP page, I kept getting the SOAP service overview HTML content being returned. I var_dumped the $HTTP_RAW_POST_DATA and it was returning NULL.

I had to change:
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : ”;


to:
$HTTP_RAW_POST_DATA = file_get_contents(”php://input”);


Everything started working correctly after making this change.

Apparently there is a bug in PHP 5.2.2 with HTTP_RAW_POST_DATA and SOAP


Now it can go into websevice's function, but still didn't return the result.
(It has no problem with PHP 5.2.1)

So I upgraded to PHP 5.2.4 from http://remi.collet.free.fr
Now NuSOAP works fine.

No comments: