How to diagnose the «Extra content at the end of the document» failure for the SOAP responses?

The «Extra content at the end of the document» means that the SOAP response is not a valid XML document and contains some unexpected text and the end.
You should check the SOAP response manually or with an XML validator to find out what exact invalid content is at the end of the document.
It could be a PHP error message, for example.