肥皂客户端停止工作

I have a website which frequently makes SOAP calls to a particular API. The site was working fine for a few months of time, however the SOAP functionality suddenly stopped working without any known reason, the error was "Cannot connect to host".

The WSDL service has not moved or shut down.

After this I updated plesk from version 12 to version 17. SOAP client is still not working but now its a different error:

SOAP-ERROR: Parsing WSDL: Couldn't load from (URL) : failed to load external entity (URL)

This is my SOAP call:

$opts = array('http'=>array('user_agent' => 'PHPSoapClient'));

$context = stream_context_create($opts);
libxml_disable_entity_loader(false);

$client = new SoapClient($url,array('stream_context' => $context,'cache_wsdl' => WSDL_CACHE_NONE));

Any possible solutions?

EDIT: New information came in, so the API server had DNS problems, how can I restore my connection to the API?

Your php server is clearly not reaching out the soap server. This might help:

  • Try checking directly from php server if the service are reachable:

    1. wget {url} > page.txt
    2. nano (or equivalent) page.txt
  • Try using other program to consume the server, I suggest Soap Ui

  • On the php server try ping the service url and see if the IP is resolved.

  • Check if any other soap service is reachable, you can use this service

If this not help you coming up with a solution, post here the results to help others solving it.