We recently had a site launch a new SOAP api service. We were able to begin using the service fine on our development environment – an exact clone of the production web app. However, when we tried connecting to the production server we received the following response to the SOAP $client->login() call:
After much frustration and a lengthy google search, we found the answer. Magento’s SOAP implementation references its own WSDL, meaning the server needs to be able to ping its own api endpoint, most likely through the external domain name you use to browse the site. If you’re not able to run a curl command for the WSDL (http://yoursite.com/index.php/api/index/index/wsdl/1/), this may be the issue.
The fix was to modify the production server’s hosts file (/etc/hosts) to include a mapping between the server’s IP address and the web app’s domain name:
Once modifying the hosts file, we were able to use the API endpoint normally.
If you’ve never debugged Magento API calls, there’s a tool called SoapUI which can be very helpful (once you figure out how to navigate the tricky UI!)