I would like to call magento SOAP using Javascript or Jquery to list the products. Anyone know how to do this?
-
I think doing SOAP with JS is hell. And I don't know why you would like to do this with SOAP?Fabian Blechschmidt– Fabian Blechschmidt2015-07-06 11:16:40 +00:00Commented Jul 6, 2015 at 11:16
-
youtube.com/watch?v=Rcq9vOgS-AoFabian Blechschmidt– Fabian Blechschmidt2015-07-06 12:41:17 +00:00Commented Jul 6, 2015 at 12:41
-
de.slideshare.net/meetmagentoes/…Fabian Blechschmidt– Fabian Blechschmidt2015-07-06 12:41:31 +00:00Commented Jul 6, 2015 at 12:41
-
possible duplicate of How to access the Magento API from native client with JavaScriptFabian Schmengler– Fabian Schmengler2015-07-06 12:50:13 +00:00Commented Jul 6, 2015 at 12:50
2 Answers
I highly recommend to NOT use SOAP. I think SOAP with JS is horrible, because you can not easily create all stubs and stuff, which you canc reate in every other language - if you can, do it!
Instead I recommend to use the REST API: http://www.magentocommerce.com/api/rest/introduction.html#RESTAPIIntroduction-Products
-
Thank you for your answer, we have created an angular js app, and I need to get product list, add to cart then order ... I think that magento REST API doesn't allow to create an order. It Only allow to list dataAKRAM EL HAMDAOUI– AKRAM EL HAMDAOUI2015-07-06 11:46:13 +00:00Commented Jul 6, 2015 at 11:46
-
But it is kinda easy to enhance the REST API to fullfill your requirements. For some cases there are already writing operations but order management is a bit of a problem with REST.Nils Preuß– Nils Preuß2015-07-06 13:53:04 +00:00Commented Jul 6, 2015 at 13:53
I recomment using a JSON adapter for the API instead, which works much nicer with JavaScript than SOAP. You can use the same API as XML-RPC (i.e. SOAP v1)
I created a very simple adapter here: https://github.com/sgh-it/jsonrpc
More details in this similar question: How to access the Magento API from native client with JavaScript
-
I have already checked out your adapter, but I didn't understand how to use it, I have imported the file into magento. Can you provide me with an example on how to list all products for example if my link is "192.168.59.132/magento/index.php/api/v2_soap/?wsdl" ?AKRAM EL HAMDAOUI– AKRAM EL HAMDAOUI2015-07-06 13:33:31 +00:00Commented Jul 6, 2015 at 13:33