Showing results for 
Search instead for 
Did you mean: 

[SOLVED] api failing to load


[SOLVED] api failing to load


I've been bang my head against this problem for a while, I was wondering if anyone had any thoughts.


We had a page displaying the Pending orders on a machine within our network, connecting via the api, this all worked ok for quite a long time.

No changes had been made yet it stopped working, the site was running when it first stopped working but is now running and fully patched.

This is the apache var/error.log, nothing shows up the Mag logs

PHP Warning:  SoapServer::SoapServer(https://[site-url]/index.php/api/index/index/?wsdl=1): failed to open stream: Connection timed out in /[mag dir]/lib/Zend/Soap/Server.php on line 814
PHP Warning:  SoapServer::SoapServer(): I/O warning : failed to load external entity "https://[site-url]/index.php/api/index/index/?wsdl=1" in /[mag dir]/lib/Zend/Soap/Server.php on line 814
PHP Fatal error:  SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://[site-url]/index.php/api/index/index/?wsdl=1' : failed to load external entity "https://[site-url]/index.php/api/index/index/?wsdl=1"\n in /[mag dir]/lib/Zend/Soap/Server.php on line 814

Debugging using SoapUI

it displays the initial call response ok but when I make the login call I get a "500 Internal Service Error" with this response (it works ok on my internal dev machine)

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=""><SOAP-ENV:Body><SOAP-ENV:Fault>
<faultstring>SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://[site-url]/index.php/api/index/index/?wsdl=1' : failed to load external entity "https://[site-url]/index.php/api/index/index/?wsdl=1"</faultstring>

Thanks in advance





Tags (1)

Re: api failing to load



The problem was the hoster made a configuration change to how certain DNS requests were handled, so a change to /etc/hosts was required and now it is working ok, hurrah.

Got tipped in the right direction by this on Stackoverflow


So, the hours spent comparing the code with the dev, getting an ear bashing from colleagues, upgrading the site, learning the joys of SoapUI... there is a very special dent in my desk with the hosting company's name on it.



Re: api failing to load

hello I have similar problem too !

my magento store is on a remote server

what DNS changes I need to tell the hosting company to make ? as I dont have access to my etc/hosts 



Re: api failing to load

Hi Gyiu,

Trying to recall the solution, it's been a while ... it's a change by the hosting company that basically blocks the machine from talking to itself, the company needs to add the machine name to the etc/hosts file to allow it, if they wont change the firewall rules.

As you don't have access to the etc/hosts I'm guessing you don't have SSH access either because you could have tried the test they suggest here.

Point them in the right direction and hopefully the support at your hosting company will know from there.

Good luck


Re: api failing to load

Hi Gyiu,

I am unable to fetch the sub-categories getting blank JSON in response like as below. I am trying to fetch all the categories and subcategories by using below code.


$proxy = new SoapClient('');
$sessionId = $proxy->login('api_user', '1234567890');
$result = $proxy->catalogCategoryTree($sessionId);


JSON Response:

object(stdClass)#2 (6) { ["category_id"]=> int(1) ["parent_id"]=> int(0) ["name"]=> string(12) "Root Catalog" ["position"]=> int(0) ["level"]=> int(0) ["children"]=> array(1) { [0]=> object(stdClass)#3 (0) { } } } 

I am stuck because without sub-categories I can't go ahead. Please help.

I have posted this question in detailed on