cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED] api failing to load

SOLVED

[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 1.7.0.2 when it first stopped working but is now running 1.9.1.1 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="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault>
<faultcode>WSDL</faultcode>
<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>
</SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

Thanks in advance

Maugan

 

 

 

Tags (1)
4 REPLIES

Re: api failing to load

 

Solved!

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

http://stackoverflow.com/questions/14822866/magento-soap-api-working-locally-but-not-remotely?lq=1

 

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 

 

please........

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.

http://stackoverflow.com/questions/14822866/magento-soap-api-working-locally-but-not-remotely?lq=1

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('http://127.0.0.1/index.php/api/v2_soap/?wsdl');
$sessionId = $proxy->login('api_user', '1234567890');
$result = $proxy->catalogCategoryTree($sessionId);
var_dump($result);

 

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 https://stackoverflow.com/questions/47262510/magento-unable-to-get-sub-categories-with-soap-api-in-r...