static void Main(string[] args) { PaymentItemConnect paymentItemConnect = null; ServiceConnect serviceConnect = null; serviceConnect = new ServiceConnect(); serviceConnect.Listen(); serviceConnect.RegisterWellKnownServiceType(); paymentItemConnect = new PaymentItemConnect(); paymentItemConnect.RegisterWellKnownServiceType(); ConsoleKey key = ConsoleKey.Spacebar; while (key != ConsoleKey.Enter) { key = Console.ReadKey(false).Key; } Console.WriteLine("Exiting Cleanly "); }
protected override void OnStart(string[] args) { try { //webServicesLog.WriteEntry("OnStart Entry", EventLogEntryType.Information); serviceConnect = new ServiceConnect(); if (serviceConnect.Listen()) { //webServicesLog.WriteEntry("Listener Started", EventLogEntryType.Information ); } else { throw (new Exception("Listener failed to Start")); } if (serviceConnect.RegisterWellKnownServiceType()) { //webServicesLog.WriteEntry("RegisterWellKnownServiceType Service", EventLogEntryType.Information ); } paymentItemConnect = new PaymentItemConnect(); if (paymentItemConnect.RegisterWellKnownServiceType()) { //webServicesLog.WriteEntry("RegisterWellKnownServiceType PaymentItem", EventLogEntryType.Information ); } //webServicesLog.WriteEntry("OnStart Completed", EventLogEntryType.Information); } catch (Exception ex) { //webServicesLog.WriteEntry(String.Format("Error OnStart: {0}", ex.Message), EventLogEntryType.Error); } }