SOAP: looks like we got no XML document

前端 未结 10 1396
日久生厌
日久生厌 2021-01-11 11:41

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:

相关标签:
10条回答
  • 2021-01-11 12:04

    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:

    1. Passed SOAP version parameter to SoapClient:

      'soap_version' => SOAP_1_1

    2. On the server php.ini configuration file I have added:

      always_populate_raw_post_data = -1

    0 讨论(0)
  • 2021-01-11 12:15

    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);

    0 讨论(0)
  • 2021-01-11 12:18

    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.

    0 讨论(0)
  • 2021-01-11 12:21

    set always_populate_raw_post_data = -1 in php.ini file (by removing the ; ) and then restart the server. It worked fine for me.

    0 讨论(0)
提交回复
热议问题