f00b4r / nusoap

:smirk: Fixed NuSOAP for PHP 5.6 - 8.2
https://f00b4r.github.io/nusoap/
318 stars 355 forks source link

NuSOAP SERVER returns 500 Internal Server Error when run in PHP 7.0.22 #25

Closed jony5 closed 6 years ago

jony5 commented 6 years ago

On localhost running PHP 7.0.22, NuSOAP Server returns NuSOAP SOAP Response header of HTTP/1.0 500 Internal Server Error...with "error in msg parsing:\nxml was empty, didn't parse!" contained in faultstring node.

The same NuSOAP server code running in production on PHP 5.5.38 successfully returns SOAP results as expected. So I'm currently testing NuSOAP Server compatibility with PHP 7.0.22 in my localhost environment.

If anyone could perhaps point me in the right direction, it would be much appreciated!

UPDATE: This error was resolved by updating how I accessed HTTP POST data in the WSDL.

jony5 commented 6 years ago

Full disclosure, I am currently running modified-from-source versions of NuSOAP library files acquired from here: https://github.com/codecasts/nusoap-php7

jony5 commented 6 years ago

UPDATE: Found out through a post on stack overflow to check and replace references to a deprecated and removed http_raw_post_data param. Replaced: $server->service($HTTP_RAW_POST_DATA); With: $server->service(file_get_contents("php://input"));

...in my WSDL endpoint...and now we got NuSOAP Server results in PHP 7.0.22.

Now my services layer is working localhost and production. Yay. Thx for your time.

f3l1x commented 6 years ago

Hi. Thanks for an issue. Could you please send a PR?

jony5 commented 6 years ago

I checked the codebase here....the only reference to $HTTP_RAW_POST_DATA is buried in a code comment for the service($data) method of the nusoap_server class.

I don't think any changes need to be made to this code, my friend. Would there be another reason for me to send a PR?

jony5 commented 6 years ago

I guess I could just close this issue at this time.

f3l1x commented 6 years ago

Hi @jony5, well as you described. There's no need for PR. :-) Thank you anyway.