I’m having problem getting basic Magento SOAP API to work (at all). I’m trying this: http://www.magentocommerce.com/wiki/doc/webservices-api/introduction. This is the result in firefox:
Warning: SoapClient::SoapClient(http://www.magento.se/magento/api/soap/?wsdl) [function.SoapClient-SoapClient]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/msoap.php on line 9
This is the failing line(1st line of script):
$proxy = new SoapClient('http://www.magento.se/magento/api/soap/?wsdl');
My Magento setup:
- Ubuntu Linux + Apache2 + PHP and all required modules [yes, phpinfo() says SOAP and WSDL is working)]
- Webserver is running on dev machine (on 127.0.0.1).
- I’ve inserted the line:
in my /etc/hosts
I downloaded Magento from SVN and followed setup instructions. It went fine and I can access both front end and back end.
Searching through this forum, I’ve found a collection of alternative URL:s for the wsdl query:
http://www.magento.se/api/soap/?wsdl # The original from the sample
http://www.magento.se/magento/api/soap/?wsdl # But Magento is one dir down!
http://www.magento.se/index.php/api/soap/?wsdl # Someone suggests going through index.php
http://www.magento.se/magento/index.php/api/soap/?wsdl # A combination
They all fail the same way here. But surely ‘magento’ must be there after server name since ‘index.php’ is located in ‘magento’ subdir from httpd root?
I also try replacing http://www.magento.se with 127.0.0.1 with same result.
Trying the WSDL URL directly in a browser, I come to a “Magento URL not found page”: “Whoops, our bad… The page you requested...”. So it seems my local Magento is unable to serve any WSDL whatsoever.
Now I wonder:
- Is there some ‘master switch’ in Magento somewhere to get SOAP functionality up and running?
- Is there some other basic configuration that needs to be done (like in Admin > System > Configuration) [I haven’t changed anything here].
I’m fairly new on PHP/Apache configuration, so I may have missed something there.
Any good advice appreciated!