Is there anything specific i need to do to get the api in magento working?
I am visiting /api/soap/?wsdl on my local installation (1.7) and it returns the following error:
Invalid webservice adapter specified.
Everything looks enabled in the site but i cant find any info on other steps i need to do to get the api to work.
I've solved this from htaccess by turning off MultiViews option like this:
from
<Directory /var/www/magento>
Options Indexes FollowSymLinks MultiViews
</Directory>
to
<Directory /var/www/magento>
Options +Indexes +FollowSymLinks -MultiViews
</Directory>
There is a different approach if you want to keep compatibility with old API calls. For some obscure reason, my Apache server doesn't analyze the string ^api/...
during the rewrite parsing.
But you can still use http://www.somedomain.com/api/v2_soap?wsdl=1
without changing Magento PHP code. You just need to change the .htaccess like the following:
Replace in .htaccess:
RewriteRule ^api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L]
by
RewriteRule ^api(\.php)?/([a-z][0-9a-z_]+)/?$ api.php?type=$2 [QSA,L]
(see the ^api.php/ instead of ^api/)
And even better if some of you, have http://www.somedomain.com/api/V2_soap?wsdl=1
(V2_soap is uppercase), you will have to add a RewriteMap
to use internal apache function to set in lowercase the parameter. Add to your virtual host the RewriteMap:
RewriteMap lc int:tolower
And in the .htaccess
RewriteRule ^api(\.php)?/([a-zA-Z][0-9a-z_]+)/?$ api.php?type=${lc:$2} [QSA,L]
This will set to lowercase the parameter for the api.php script and also accept 'V2_soap' in the regular expression
This last part has been brought by @dreeves in this answer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With