13 กันยายน 2550

NuSOAP & PHP 5.2.2 problem

NuSOAP มีปัญหากับ PHP 5.2.2 ครับ ทำให้ใช้ NuSOAP ไม่ได้เลย

ทีแรกเลย มันไม่ยอมเข้าไปในฟังก์ชันของ webservice
พอลองแก้ตามนี้
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


มันยอมเข้าไปในฟังก์ชันของ service แล้วครับ
แต่พอเข้าไปทำงานเสร็จ ก็ไม่ยอม return ผลลัพธ์ออกมา
แต่กับ PHP 5.2.1 ไม่มีปัญหาครับ

หลังจากบังคับอัปเกรดเป็น PHP 5.2.4 เถื่อน
(เถื่อนจริงๆนะ ของอีตา remi อะไรไม่รู้ http://remi.collet.free.fr )
ก็จะใช้ NuSOAP ได้ตามปรกติแล้วครับ

ไม่มีความคิดเห็น: