I\'m trying to create a web service but before I do I\'m trying to get a simple example that I found on the internet to work first but I keep getting the following error:
Pretty late but adding my fix to benefit of others. I have got similar error when I changed my Apache server from 2.2 to 2.4 and PHP 5.4.10 to 5.6.18 on windows. Client app used php 5.6.1. To fix the problem, I have done the following:
Passed SOAP version parameter to SoapClient:
'soap_version' => SOAP_1_1
On the server php.ini configuration file I have added:
always_populate_raw_post_data = -1
I received this error when I was interacting with the Magento API which was loading a model, and it was throwing a warning before outputting the xml response which was causing the error.
To fix it you can simply turn off warnings on the API function: error_reporting(0);
The post is old, but I think it's always helpful, because I became crazy to not understand why this error appeared.
The solution for me was here: PHP SOAP client that understands multi-part messages?.
I had to extend the SoapClient to manage the MTOM encoding to obtain a clean XML as response.
I hope it can help someone.
set always_populate_raw_post_data = -1
in php.ini file (by removing the ;
) and then restart the server. It worked fine for me.