The accepted answer works, but only in a mode other than WSDL. If you try to use this in WSDL mode (for example, you pass the URL of the WSDL file as the first argument), you will have to face the fact that when loading a WSDL stream, the context of the stream is ignored. Therefore, if the WSDL file is also located on the server with a broken certificate, it will fail, most likely it will throw the message failed to load external entity . More details here and here .
As suggested, the easiest way is to manually load the WSDL file and transfer the local copy to SoapClient. You can load it, for example, with file_get_contents , using the same stream context from the received answer.
Note that you will also need to do this when creating SoapServer.
tobik Jun 24 '15 at 9:15 2015-06-24 09:15
source share