I tried to make a soap request but i always faced the same error until i disabled the remote_stream_wrapper module.
Here is my soap call :
$soap = new SoapClient('http://example.com?wsdl');
Here is the error :
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://example.com?wsdl' : failed to load external entity "http://example.com?wsdl"
I figured out that this is produced when it reach the DrupalRemoteStreamWrapper::stream_stat, precisely :
$request = drupal_http_request($this->uri, array('method' => 'HEAD'));
in file remote_stream_wrapper.inc line 273
This is because my wsdl service is only reachable through GET method, the HEAD method return a "500 Erreur Interne de Servlet"
Comment | File | Size | Author |
---|---|---|---|
#6 | remote_stream_wrapper-fallback-to-get-1986026-6.patch | 3.36 KB | twistor |
#3 | 1986026-3-fall_back_to_GET.patch | 814 bytes | raytiley |
Comments
Comment #1
Jovean CreditAttribution: Jovean commentedYou can work around this by storing a copy of the SOAP services WSDL locally using CURL with something like this:
Comment #2
Jovean CreditAttribution: Jovean commentedundoing priority change that I didn't intend.
Comment #3
raytiley CreditAttribution: raytiley commentedThis patch falls back to GET if HEAD returns an error.
Comment #4
openminds CreditAttribution: openminds commentedFYI: This patch fixes a problem we experienced using a Soapclient call within a Drupal+Commerce Kickstart setup
Comment #5
Fernly CreditAttribution: Fernly commented#3 seems to work for me. Error fixed.
Comment #6
twistor CreditAttribution: twistor as a volunteer commentedThis patch fixes a few things:
1) It removes the HEAD request from stream_stat(). stream_stat() is called in response to fstat() meaning we have already downloaded the file, so just return the length of the content. That alone should fix the previous issue.
2) Allows HTTP responses with zero length. That's a perfectly valid HTTP response, there's no reason to consider it invalid.
3) in url_stat() try a HEAD request, then fallback to a GET request. url_stat() is called in response to stat() meaning we don't already have an open file handle.
Comment #7
paul.linney CreditAttribution: paul.linney commentedPatch in #6 fixed the issue for my current project, that uses a number of SOAP services :)
Paul
Comment #8
NotGoddess CreditAttribution: NotGoddess commentedI was running into issues with SOAP too - SOAP-ERROR: Parsing WSDL: Couldn't load from external entity.
My calls would work with pure PHP and on other Drupal sites but not one particular install. I didn't make the connection with remote stream wrapper being enabled until after hours of debugging.
The patch in #6 solved my issue and it doesn't seem to conflict with why I have RSW on the site - external resources. They still work just fine.
Comment #9
Chris Gillis CreditAttribution: Chris Gillis commentedI've been having the same SOAP error. Took me ages to track it to this module... turn the module off, SoapClient works fine. Switch it on and
SOAP-ERROR: Parsing WSDL: Couldn't load from [redacted] : failed to load external entity
. I've tried the patch in #6 against 7.x-1.0-rc1 and it does NOT fix my error... Any other ideas?Comment #10
arek611 CreditAttribution: arek611 commentedUsing patch in #3 with rc1 and it fixed the issue on our end with Drupal Commerce and the Click&Pledge payment gateway.
Comment #11
rkostov CreditAttribution: rkostov commentedThe patch in #6 (version 7.x-1.0-rc1) doesn't fix my error because it looks for '$request->code == 405' in doUrlStat(). But the error I have is -1002. The patch in #3 does fix the error.