A little while ago I noticed some Soap errors emitting from my app and I started to investigate them. Stuff like:
SoapClient::SoapClient(http://###.###.###.###:8080/path/to/some.wsdl): failed to open stream: HTTP request failed!
SoapClient::SoapClient(): I/O warning : failed to load external entity "http://###.###.###.###:8080/path/to/some.wsdl"
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://###.###.###.###:8080/path/to/some.wsdl' : failed to load external entity "http://###.###.###.###:8080/path/to/some.wsdl"
It looked like a timeout on the remote server (WSDL caching was turned off). After bouncing that server and having no luck, I tried to just file_get-contents()
the WSDL to see what would happen...
No dice: After about 20 seconds or so I got the same stream error:
file_get_contents(http://###.###.###.###:8080/path/to/some.wsdl) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: HTTP request failed!
In a last ditch effort, I tried to read the contents via the curl_*
functions, and I do in fact get what I'm looking for.
... tl;dr?
- SoapClient and file_get_contents appear to be timing out (though not an explicit "Failed to open stream, connection timed out")
- It appears to be related to streams since curl gives me what I'm looking for.
- I've got a lot of code that depends on
SoapClient
andfile_get_contents
so switching to an all curl solution isn't really an option. - This is not a DNS issue as I can resolve external names fine (and my target resource is an IP)
-
allow_url_fopen
is enabled.
Any ideas?