private static void IngestTestData(TestMessage msg, string queueName) { // "Programming WCF Services" 3rd edition by Juval Lowy pp 259-260 recommends the // following form when needing to catch exceptions near the SendQueuedTestMessage(). DataFeedsClient proxy = new DataFeedsClient(queueName); try { proxy.IngestTestData(msg); proxy.Close(); Console.WriteLine("{0}.IngestTestData(): Test message enqueued Ok.", m_ThisName); ConsoleNTraceHelpers.DisplayTestMessage(msg); } catch (Exception ex) { Console.WriteLine("{0}.IngestTestData(): Proxy threw exception\n {1}.", m_ThisName, ex); proxy.Abort(); } }
private static void IngestTestData(TestMessage msg, string queueName) { // Allow calculation of elapsed time: From proxy instantiation // till the message is received by the instantiated service instance. msg.MessageSendDateTime = DateTime.Now; // "Programming WCF Services" 3rd edition by Juval Lowy pp 259-260 recommends the // following form when needing to catch exceptions near the SendQueuedTestMessage(). DataFeedsClient proxy = new DataFeedsClient(queueName); try { proxy.IngestTestData(msg); proxy.Close(); Console.WriteLine("{0}.IngestTestData(): Test message enqueued Ok.", m_ThisName); ConsoleNTraceHelpers.DisplayTestMessage(msg); } catch (Exception ex) { ConsoleNTraceHelpers.DisplayExToConsoleNTrace(m_ThisName + ".IngestTestData(): ", ex); proxy.Abort(); } }