Magento Forum

   
API Soap - magento/api/?wsdl is not working - what am I doing wrong
 
Peter Snows
Jr. Member
 
Total Posts:  12
Joined:  2008-07-16
 

Hello everyone,

I am trying to use the API service:
http://www.magentocommerce.com/wiki/doc/webservices-api/introduction

The problem is that when I past this links:
http://10.1.1.25/magento/api/?wsdl
http://10.1.1.25/magento/api/soap/?wsdl
on a broswer I don’t get anything. Actually I get the 404 Not Found error.

On the server I don’t see any api directory.

root@dnlweb:/var/www/magento# ls -al
total 112
drwxr
-xr-x 14 root root  4096 2008-08-29 18:38 .
drwxr-xr-x  3 root root  4096 2008-08-29 18:38 ..
drwxr-xr-x  3 root root  4096 2008-08-27 23:26 404
drwxr
-xr-x  6 root root  4096 2008-08-27 23:26 app
-rw-r--r--  1 root root  1175 2008-08-27 23:26 cron.php
drwxr
-xr-x  2 root root  4096 2008-07-17 15:22 dnl
drwxr
-xr-x  7 root root  4096 2008-08-27 23:26 downloader
drwxr
-xr-x  2 root root  4096 2008-07-17 15:22 electra
-rw-r--r--  1 root root  1150 2008-04-28 15:36 favicon.ico
-rw-r--r--  1 root root  4449 2008-08-27 23:26 .htaccess
-rw-r--r--  1 root root  4420 2008-08-27 23:26 .htaccess.sample
-rw-r--r--  1 root root  1647 2008-08-27 23:26 index.php
-rw-r--r--  1 root root  1659 2008-08-27 23:26 index.php.sample
-rw-r--r--  1 root root  5533 2008-04-28 15:36 install.php
drwxr
-xr-x 11 root root  4096 2008-08-27 23:26 js
drwxr
-xr-x  7 root root  4096 2008-08-27 23:13 lib
-rw-r--r--  1 root root 10410 2008-08-27 23:26 LICENSE.txt
drwxrwxrwx  3 root root  4096 2008
-06-18 00:20 media
-rwxr-xr-x  1 root root  2982 2008-04-28 15:36 pear
drwxr
-xr-x  2 root root  4096 2008-08-27 23:26 pkginfo
drwxr
-xr-x  3 root root  4096 2008-08-27 23:26 report
drwxr
-xr-x  5 root root  4096 2008-06-18 00:20 skin
drwxrwxrwx  6 root root  4096 2008
-08-29 18:14 var
root@dnlweb:/var/www/magento#
root@dnlweb:/var/www/magento#  du | grep api
8       ./downloader/pearlib/download/Mage_Core_Modules-1.1.3/Mage/Api/sql/api_setup
48      
./downloader/pearlib/download/Interface_Adminhtml_Default-1.1.2/adminhtml/default/default/template/api
8       
./app/code/core/Mage/Api/sql/api_setup
48      
./app/design/adminhtml/default/default/template/api
root
@dnlweb:/var/www/magento#

I have MAgento 1.1.3.
I would apreciate any help.

Thanks,

Pedro

P.S.  Thanks Magento Team. Great Job!

 
Magento Community Magento Community
Magento Community
Magento Community
 
clorne
Sr. Member
 
Total Posts:  236
Joined:  2008-01-10
London
 

This thread may help

http://www.magentocommerce.com/boards/viewthread/13494/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gregersen
Member
 
Total Posts:  57
Joined:  2008-06-15
 

I have the same problem.. No API directory… The link doesn’t help me…
What to do then?

 
Magento Community Magento Community
Magento Community
Magento Community
 
joyously
Guru
 
Total Posts:  447
Joined:  2008-08-21
 

There’s no api directory. It’s a redirect, or should be.
Like the other thread says, you might have to use index.php/api/?wsdl instead.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Peter Snows
Jr. Member
 
Total Posts:  12
Joined:  2008-07-16
 

I can get something if I use this link:
.  http://10.1.1.25/magento/index.php/default/api/?wsdl
but this one:
.  http://10.1.1.25/magento/index.php/api/?wsdl
does not return anything.
Why is that ? Is this correct ?
On the documentation :
.  http://www.magentocommerce.com/wiki/doc/webservices-api/introduction
I can see a different link.

I get the file with the following code:

...
<
service name="MagentoService">

<port name="Mage_Api_Model_Server_HandlerPort" binding="typens:Mage_Api_Model_Server_HandlerBinding">
<
soap:address location="http://10.1.1.25/magento/index.php/default/api/index/index/"/>
</
port>
</
service>

Is this link :
.  http://10.1.1.25/magento/index.php/default/api/index/index/
correct ?
Or is something wrong with my installation ?

Thanks,

Pedro

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kerry Hatcher
Sr. Member
 
Avatar
Total Posts:  96
Joined:  2008-07-15
Macon, GA
 

I struggled for days to get my API working, make sure you have php5-SOAP installed on your server, they don’t list that as a suggestion or a requirement in the install notes.

Check this out http://www.magentocommerce.com/boards/viewthread/15480/

Hope this works!

 
Magento Community Magento Community
Magento Community
Magento Community
 
PistolGrip
Jr. Member
 
Total Posts:  4
Joined:  2008-08-22
 

One thing I dicovered after a day and a half of trying to get the API to work…

If you install php-soap or php-xmlrpc AFTER Magento the API still doesn’t work. I couldn’t get anything but 404’s on valid API URL’s.

So, I finally decided to try a fresh installation of Magento after SOAP and XMLRPC were installed it worked immediately. I guess the Magento installation disables the API if it doesn’t find the modules???

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kerry Hatcher
Sr. Member
 
Avatar
Total Posts:  96
Joined:  2008-07-15
Macon, GA
 

yea it is a bit of a pain. they really should mention that on the install required packages list but just but (optional) next to them. I did speak with someone from Varien on the phone and he said that would be a good idea also. So maybe it will happen.

Thanks,

 
Magento Community Magento Community
Magento Community
Magento Community
 
Peter Snows
Jr. Member
 
Total Posts:  12
Joined:  2008-07-16
 

Thanks for the reply.
I have them installed (rpc and soap).
I can get the wsdl file.

I just don’t understand why in my setup I need to add the “default” keyword, when other people doesn’t seem to need it.

I have to use:
.  http://10.1.1.25/magento/index.php/default/api/?wsdl
instead of:
.  http://10.1.1.25/magento/index.php/api/?wsdl

I just would like to know if anyone has the same problem ?
or if anyone knows why is this happening ?

Cheers,

Pedro

 
Magento Community Magento Community
Magento Community
Magento Community
 
Rico_Neitzel
Enthusiast
 
Avatar
Total Posts:  857
Joined:  2007-09-05
Würzburg, Germany
 

i got it… (yoav helped a bit wink

that /default/ is your store-code
you have “include storecode in url” in system -> config active… set to “no” and it works fine!

rico

 
Magento Community Magento Community
Magento Community
Magento Community
 
thE_iNviNciblE
Sr. Member
 
Avatar
Total Posts:  220
Joined:  2008-01-09
Oldenburg
 

hello rico,

this issue appears in 1.2.1 i’ve tried to connect via SOAP with .NET 08 ...

it’s related to http://www.magentocommerce.com/boards/viewthread/13158/

 
Magento Community Magento Community
Magento Community
Magento Community
 
jds013
Jr. Member
 
Total Posts:  1
Joined:  2013-07-03
 

The .htaccess file generated by magento includes this rewrite rule which would fix the problem:
RewriteRule .* index.php [L]

To enable this, you need to have this in your Apache Directory section (rather than \\\\\\\\\\\\\\\"AllowOverride None\\\\\\\\\\\\\\\"):
AllowOverride All

and you need to uncomment this in your httpd.conf:
LoadModule rewrite_module modules/mod_rewrite.so

Restart Apache and you should be OK

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top