SOAP: looks like we got no XML document

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


A bit late, but this kinda error is often caused by server-side (SOAP sense) problem :

  • print/echo content
  • rik's answer too
  • mistake (eg I was currently having this error because of a miswritten filename in an include, generating an include error instead of executing the script...)
  • bad parameter in SOAP server
  • not the same compression level both sides (if compression used)

This message just inform you that the SOAP client did not receive well-formatted XML (eg. an error message instead of XML).


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


A byte order mark (BOM) would have the same effect as whitespace before the php tags. Here you find a PHP snippet to detect and remove a BOM. Be sure to configure you editor to not insert the BOM again.

Tags:

Php

Soap

Nusoap