Uncaught SoapFault exception: [WSDL] SOAP-ERROR: - php

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.

Related

Fatal error: Uncaught SoapFault exception: [WSDL] in php

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

Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from '< URL HERE >' : failed to load external entity

I'm trying to connect to a WSDL feed, this works fine from my local machine (Windows) but not from the web server (Linux). When I attempt a connection I get this error:
Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL:
Couldn't load from
'http://services.clfdistribution.com:8080/CLFWebOrdering_Test/WebOrdering.asmx?WSDL'
: failed to load external entity
I've compared the phpinfo readouts from both machines and everything seems to match except that the working one (local PC) is PHP 5.5.36 and the non-working one (web server) is PHP 7.0.22
I've tried various fixes that I've found and nothing seems to work. Some other feeds do work but not the one I need to connect to.
We have cPanel access but no ability to edit PHP configuration (host is SiteGround).
This has now been resolved - Siteground were blocking port 8080, once this restriction was removed it all worked fine.

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from '' : failed to load external entity

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.

SoapFault exception on localhost only

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"

SOAP-ERROR: Parsing Schema: unexpected <element> in complexType

When trying to connect to a web service using the following
$client = new SoapClient("http://vocab.ndg.nerc.ac.uk/1.1/VocabServerAPI_dl.wsdl");
I get this error message
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: unexpected in complexTyp
Which seems odd as all I am doing is trying to connect to it not use any functions from it.
Does anyone know what would be causing this error?
The WSDL itself. There is something wrong with the way the WSDL is written when this error comes up. What exactly? I don't know.

Categories