public static void CreateSubscription(string guid) { string serviceUrl = "http://p138.coil.sap.com:8080/sap/opu/sdata/sap/ZCRM_LEAD"; ZCRM_LEAD.ZCRM_LEAD service = new ZCRM_LEAD.ZCRM_LEAD(new Uri(serviceUrl)); service.Credentials = new NetworkCredential("proen", "invent1"); ZCRM_LEAD.Subscription s = new ZCRM_LEAD.Subscription { deliveryAddress = "http://lehavi.com:2057/Sap/LeadUpdated", scheme_agency_id = "", scheme_id = "", value = "", collection = "zxact_leadCollection", filter = "",//string.Format("value eq '{0}' and scheme_id eq '{1}' and scheme_agency_id eq '{2}'", guid, "ZXACT_LEAD", "CR7_800"), select = "*" }; service.AddToSubscriptionCollection(s); try { var res = service.SaveChanges(); } catch (Exception ex) { Console.Write(ex.Message); } }
public static string CreateLead(string msg) { string serviceUrl = "http://p138.coil.sap.com:8080/sap/opu/sdata/sap/ZCRM_LEAD"; ZCRM_LEAD.ZCRM_LEAD service = new ZCRM_LEAD.ZCRM_LEAD(new Uri(serviceUrl)); service.Credentials = new NetworkCredential("proen", "invent1"); ZCRM_LEAD.zxact_lead l = new ZCRM_LEAD.zxact_lead { description = msg, long_text = msg, scheme_agency_id = "", scheme_id = "", value = "" }; service.AddTozxact_leadCollection(l); try { var res = service.SaveChanges(); return l.value; } catch (Exception ex) { Console.Write(ex.Message); return null; } }