create web reference to wsdl AIP Reference here
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using MagentoPushPull.com.renewlife.staging; using System.Security.Cryptography.X509Certificates; using System.Configuration; using System.Net; using System.Net.Security; private void button1_Click(object sender, EventArgs e) { TypeClient ws = new Mage_Api_Model_Server_V2_HandlerPortTypeClient(); MagentoService ws = new MagentoService(); string wsSessionID = string.Empty; ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(myCertificateValidation); //X509Certificate clientCert = X509Certificate.CreateFromCertFile(ConfigurationSettings.AppSettings["ClientCertDir"]); //ws.ClientCertificates.Add(clientCert); textBox1.Text = "login" + "\r\n"; wsSessionID = ws.login("user", "api_key"); ws.salesOrderListCompleted += new salesOrderListCompletedEventHandler(ws_salesOrderListCompleted); textBox1.Text = textBox1.Text + "call sales order async " + "\r\n"; ws.salesOrderListAsync(wsSessionID, null, ws); } void ws_salesOrderListCompleted(object sender, salesOrderListCompletedEventArgs e) { salesOrderEntity[] soe = e.Result ; if (soe.Length > 0) { foreach (salesOrderEntity msoe in soe) { try { textBox1.Text = textBox1.Text + "" + msoe.order_id + " " + msoe.grand_total + "\r\n"; MagentoService ws = new MagentoService(); string wsSessionID = string.Empty; textBox1.Text = "get order detail" + "\r\n"; wsSessionID = ws.login("user", "api_key"); ws.salesOrderInfoCompleted += new salesOrderInfoCompletedEventHandler(ws_salesOrderInfoCompleted); //salesOrderEntity soInfo = ws.salesOrderInfo(wsSessionID, msoe.increment_id); // foreach (salesOrderItemEntity soie in soInfo.items) // { // textBox1.Text = soie.sku + "\r\n"; // } ws.salesOrderInfoAsync(wsSessionID, msoe.increment_id,ws); } catch (Exception merror) { MessageBox.Show("" + msoe.order_id + "" + merror.ToString()); } } } else { textBox1.Text = textBox1.Text + "No orders" + "\r\n"; } } void ws_salesOrderInfoCompleted(object sender, salesOrderInfoCompletedEventArgs e) { salesOrderEntity soe = e.Result; if (soe.items.Length > 0) { foreach (salesOrderItemEntity soie in soe.items) { textBox1.Text = "order detail - " + soie.sku + " " + soie.name + "\r\n"; } } }