Wednesday, October 6, 2010

Accsess The Magento Core API With Dot net technologies

Magento is one of the most popular e-commerce platforms.which based  on PHP and Mysql.Magento Core API supports both SOAP and XML RPC protocols. The API is permission based and allows access to the Customer, Catalog and Order modules of Magento. Please reference the documentation for more information.
This article I am going to explaining How to access magento web service from Dot net Technologies .
we can access magento soap api with following url.
http://mymagento.com/api/v2_soap?wsdl (You can see wsdl definition by typing this url in web browser).
So let see how to display Magento customer list in my WindowsFormsApplication project.
To consume to the magento web service in our application we should add web Reference by rigth click on solution .

In the web reference dialog box type the magento web service URL (http://mymagento.com/api/v2_soap?wsdl) and click Go button then available service method display as following screen.
Then we can change the web service name and click Add Refference button.

 By doing above steps,we can generate  the web service proxy .
C# code to retrieve  customer list.
 using Magento.com.mymagento

public void  showCustomrs(){
   MagentoService ms = new MagentoService();
   string sesion= ms.login("Dinesh", "123456");
   filters myfilter=new filters();//filter criteriya
   customerCustomerEntity[] cusls= ms.customerCustomerList(sesion,myfilter);//get customers
   dgCutomer.ItemsSource = cusls; //display in grid
}