Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from '...xxx?wsdl' : failed to load external entity
Assuming there are no issues with your web server configuration and the remote server is online, you may want to check if the SSL Certificate associated with the external entity is valid.
Before checking if the SSL Certificate is valid, we have attached to this article a zip archive containing some PHP SoapClient scripts known to be working.
Using these PHP SoapClient scripts, you can compare results and confirm if your web server configuration is working as intended. If you are not receiving any output in either of those scripts, the issue might be related to the system configuration.
If you can open these scripts in your browser without seeing an error, it means the web server is correctly configured and working as intended on your side. Feel free to proceed to the next step if that's the case. If it's not, please contact us.
To check if the SSL Certificate is valid, you may use a third-party tool, such as:
Important observation: If the URL associated with the external entity opens correctly in your browser or your local machine, it doesn't mean the SSL Certificate is completely valid. Depending on the operating system, libraries on it, other web server configurations associated, and SoapClient version, it might be possible that only your SoapClient identifies the SSL Certificate located on the external server as invalid.
In a specific case we troubleshooted, no errors were showing when the Curl command was executed on the server (to clarify, the server where we were trying to execute the SoapClient script). However, when the same command was executed on another device with a different operating system and libraries, we could see the following error:
curl: (60) SSL certificate problem: certificate has expired curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
Basically, we learned that the Curl command and SoapClient were presenting different responses on the very same server.
If the SSL Certificate is invalid, the obvious course of action would be to fix the SSL Certificate on the remote server. However, that is not always possible.
One of the workarounds available is to disable the SSL Certificate verification within the code of your SoapClient script.
The following example works for the PHP SoapClient: https://stackoverflow.com/questions/8443618/disable-certificate-verification-in-php-soapclient.
The last time we were contacted regarding this issue, the cause was an invalid SSL Certificate installed on the remote server. After applying the solution above, it was possible to resolve it.
Please note that you usually need to be a web developer or a highly-skilled system administrator to apply the solution above.
If that's not your case, and if the issue you are having is confirmed to be related to an invalid SSL Certificate, you might want to contact the support team of the remote server to install a valid SSL Certificate instead. Alternatively, you can hire us or a third party to apply the solution for you.
If your issue is not related to the solution presented above or you require additional assistance, please contact us.