If you’re like me you’ve been tasked with integrating the magento online system with legacy order fullfillment and accounting software in the back office. This guide serves to help anyone looking to use visual studio 2008 to program a c# application for ushering data in and out of magento. This guide is meant for version 220.127.116.11 though it may work with other versions. It should also be noted that I am using the .net framework version 3.5 though i’m not sure that’s relevant.
The first thing you need to do is log into magento and create a user and give him/her permission to query the api.System→Web Services
remember you api key because you will use it in the following steps.
Open up visual studio and create a new project. Mine was windows forms based. Under solution explorer right click and choose Add Service Reference when the dialog comes up click advanced. Next click Add Web Reference enter in the path to your wsdl file. and example would be
You should now see “MagentoService” Description with a bunch of methods underneath.
set the web reference name in this case it would be com.exampledomain.www
Click Add Reference
You should now have a reference in the solution explorer. In order to use this in you project you simple need to put a
You will then have access to the MagentoService object. This will be your primary object for interacting with magento. The following code serves to illustrate how you would use the MagentoService class.
This code gets you all of the orders that are greater than a specified ordernumber and then iterates through each printing the billing firstname and the subtotal to the debugger.
The rest is up to you.