2
votes

I am working on Magento Soap API v2 and developing a desktop C# application.

Correct behaviour :

  1. On another hosting this magento api works fine anyway
  2. On this hosting (rack-space), If I open the api link (http://162.242.xx.xx/dnmagento/index.php/api/v2_soap?wsdl=1) through browser, it works fine

Undesired behaviour: On this hosting (rack-space), I can not connect api programatically (c# or php)

  private void login_Click(object sender, EventArgs e)
  {
      magWebReference.MagentoService mag = new magWebReference.MagentoService();

      // Throws exception here
      string sessionID=mag.login("apiuser","password"); 

      MessageBox.Show(sessionID);
  }

I get following error while connecting

SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://162.242.xx.xx/dnmagento/index.php/api/v2_soap/index/?wsdl=1' : failed to load external entity "http://162.242.xxx.xx/dnmagento/index.php/api/v2_soap/index/?wsdl=1"

Note : In reported error /index/ is automatically added after /v2_soap. while in provided link there is no /index/.

2

2 Answers

0
votes

This is usually a problem when the PHP soap client itself cannot resolve the URL for the SOAP client. I had faced a similar issue previously and found the issue to be in the server setup. The magento server setup maybe rejecting any calls which does not have a user agent string attached to it. Please do a check on the HTTP access logs and confirm if this is the issue.

0
votes

I had the same problem upgrading to Magento 1.9.0.1. I solved the problem with this official patch