Labels

Saturday, August 9, 2014

Magento API soap call in C#: Integration

I came up with a new task i.e Magento API SOAP calling in asp.net C# application. This platform is mostly used by the PHP developers. Interestingly, i got this task in the Dot net side. Magento basic topics looks like simple and easy to do but when we are going to the topic deeper and deeper then everything will looks like a tough and tight. Required PHP framework installed server to install Magento platform i.e another part of work to install Magento into your server. To know more about Magento installation(click here) and Soap API(click here).

After successful Magento installation, you will be provided with your API details like serviceURL, ApiUserName, ApiUserKey and store details. I have used V2 SOAP version here.

Adding a Web Reference:

First, create a new Asp.net C# web application. Then right click on the project and select 'Add service Reference'.

After selecting 'Add Service Reference'. You will get a new window called 'Add Service Reference'. Click on 'Advanced' button.

Then, you will another window called 'Service Reference Settings'. Click on 'Add Web Reference' button.

Give your Magento hosted URL.Then click on 'Go' button to get the Magento Service.
There are two SOAP version in Magento. I have used version 2 here.
EX:
SOAP v1 url: http://Hostname/api/soap/?wsdl=1
SOAP v2 url: http://Hostname/api/v2_soap/?wsdl=1

If URL access then you will get the service list as like below. And then click on 'Add Reference' button to complete the process.

On successful, you will get the reference in your project as like below.