Jun 06
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.
2 Comments
[Post comment]
1
Posted by Jough Dempsey | Wednesday 19 September 2007 3:09 PM
There are some namespace conflicts with the old NUSOAP library and PHP 5. You should use the built-in SOAP classes that come with PHP 5 (although the extension may not be enabled by default). It's fast, written in C, and included in the PHP binary so it's really fast. Did I mention it was fast?
NUSOAP was great for PHP 4 but the extension outperforms the PHP-implemented solution in every vector.
2
Posted by James Netherton | Wednesday 19 September 2007 3:58 PM
Hi there, and thanks for your comment!
I have some projects on the horizon that require extensive use of webservices. Looks like I'll be using the built in classes then.