SOAP: looks like we got no XML document SOAP: looks like we got no XML document php php

SOAP: looks like we got no XML document


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.


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