Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing
WSDL: Couldn't load from "url" failed to load external entity.
I am getting below error when used SoapClient in the code. How to resolve this?
You should double check the URL to the SOAP service you require, and that it does indeed serve a wsdl (add ?wsdl to the end of the URL and inspect in a browser).
It sounds like your SOAP Service URL is missing a WSDL (service discovery) or is not finding a valid SOAP endpoint.
If you care to share your SOAP URL I can provide example or I/others might be able to help more.
Could also be character encoding or User Agent filtering on the SOAP endpoint, have a read of this question : SOAP-ERROR: Parsing WSDL: Couldn't load from - but works on WAMP
Related
I'm trying to setup a Magento API, but when I try to access the API URL I get a 404
For example, http://localhost/magento/api or http://localhost/magento/api/?wsdl go nowhere.
So when I try to connect to the server with the SoapClient I always get an error like this:
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost/magento/api/soap/?wsdl' : failed to load external entity "http://localhost/magento/api/soap/?wsdl" in /var/www/html/magento/soapclient.php:3 .
In fact, when I can't open the WSDL XML with the browser nor access the /api endpoint.
Do I have to do anything else before get ready to work with the SOAP API?
I think that you already solve your problem, but just to document. If you does not use CURL URL, you need to use the path to your WSDL using the
link: http://magentohost.com/index.php/api/soap/?wsdl
I have a requirement to write Soap Client in PHP to call a remote web service and get information. For that I got the Soap End Point URL which doesn't seems to be a WSDL.
I got the WSDL file in the IEPD document set for that Soap services.
When I tried to create new instance of the SoapClient using the End Point it is throwing below error.
"Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://...' : failed to load external entity "https://.." in..."
Can you please help me how should I find WSDL url using an endpoint? or is there any other way I can call the Soap using this end point without getting this error?
To add more reference, I have received the complete documentation of the SOAP webservice in a IEPD document.
Thanks
I suggest you have a look at PHP SoapClient documentation. Start with constructor function SoapClient::SoapClient. There are examples of non-WSDL usage
This is the error I get:
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing
WSDL: Couldn't load from
'http://subdomain.example.com:105/Example/Example.asmx?WSDL' : failed
to load external entity
"http://subdomain.example.com:105/Example/Example.asmx?WSDL"
as a result of this request:
$client = new SoapClient('http://subdomain.example.com:105/Example/Example.asmx?WSDL');
WHAT I TRIED:
Accessing this exact resource from my localhost or web browser also works.
Accessing other resources which don't have :105 works (if that could matter).
Tried to do socket_create_listen(105) but gotten "Permission denied" error. Then tried to enable Port 105 via WHM by adding it firewall to the list of ports (IPv4, IPv4, TCP and UDP). All that still didn't work and there was no response from port 105.
allow_url_fopen is switched On.
default_socket_timeout is set to 300.
Tried this answer: https://stackoverflow.com/a/7118802 (parameters that I changed are URL and port - which I changed to 105. Other parameters I've left literally identical, maybe that was a mistake?)
As per some other SO answers, tried using https instead, doesn't work. Tried adding www. but that URL doesn't even exist.
Tried echoing file_get_contents() as per this answer: https://stackoverflow.com/a/14729295/525445 - it gives me a blank screen.
Tried this: Fatal error: Uncaught SoapFault exception: [WSDL] which has resulted in
Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to
host
Tried fetching it with cURL, as suggested here: https://stackoverflow.com/a/5311925/525445 The response I got is bool(false)
I had the exactly same problem today. In my case, the reason lied some steps higher. It's a magento installation and it didn't work, because i didn't whitelist api calls (even though I whitelisted my IP, what strangely wasn't enough). For me, the fix:
if (file_exists($maintenanceFile) && !in_array($ip, $allowed) && !strstr($_SERVER['REQUEST_URI'], 'v2_soap')) {
include_once dirname(__FILE__) . '/errors/503.php';
exit;
}
did it.
Should you NOT use magento, this could be nonetheless interesting for you, as it shows, that the reason can lay on a index or a htaccess file, layers above the wdsl itself. With the browser i could access the address, just like you. So maybe there's a controll switch in your system, that kills the request.
i am getting this error on current server :
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://.......'
and same code and services works on my another server and loacalhost ....
what can be the reason for this error ?
This error occurs when the client can't download the remote WSDL.
The PHP configuration setting allow_url_fopen must be On in order for the SOAP Client to access the remote WSDL.
If that doesn't solve it then it means that your current server is stopping PHP from connecting and loading the WSDL. This could be due to a firewall rule or some other outbound connectivity problem.
Having searched through the many questions related to this error already posted, I've been unable to find an answer.
When I try and connect to a URL via soap, it works fine on a Godaddy VPS but fails on my localserver (EasyPHP AMP Stack). Open SSL is enabled as is Soap in php's ini settings but does anyone know what I'm missing as I guess it's a config issue?
The code I'm running is
$gdAuctionsWSURL = 'http://auctions.godaddy.com/gdAuctionsWS/GdAuctionsBiddingWS.asmx?WSDL';
$gdAuctionsWS = new SoapClient($gdAuctionsWSURL);
and the error that only occurs on my local server is
Fatal error: Uncaught SoapFault exception:
[WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://auctions.godaddy.com/gdAuctionsWS/GdAuctionsBiddingWS.asmx?WSDL' :
failed to load external entity "http://auctions.godaddy.com/gdAuctionsWS/GdAuctionsBiddingWS.asmx?WSDL"