// Note how the DataFeedManager service composes other services. The Engine and DataAccessor // services are hosted and run "in process" to this DataFeedManager service via // the ServiceModelEx InProcFactory. Please see "Programming WCF Services", 3rd Edition // by Juval Lowy, pp 71-74 for more information. void IDataFeeds.IngestTestData(TestMessage msg) { DateTime msgReceivedTime = DateTime.Now; Debug.Assert(msg != null); //string displayMsg = string.Format("{0}.IngestTestData(): Entered:", m_ThisName); //ConsoleNTraceHelpers.DisplayInfoToConsoleNTrace(displayMsg); // Check validity. InProcessFeedMsg checkedMsg = null; IFeedValidityEngine validityEngProxy = InProcFactory.CreateInstance <ValidityEngine, IFeedValidityEngine>(); checkedMsg = validityEngProxy.IsTestMessageValid(msg, msgReceivedTime); InProcFactory.CloseProxy(validityEngProxy); Debug.Assert(checkedMsg != null); if (checkedMsg.IsValid) { // Used only with a test client. DisplayMsgAndQueueLength(msg, checkedMsg); // Save data. IIngestedDataDA ingestDataDaProxy = InProcFactory.CreateInstance <IngestedDataDA, IIngestedDataDA>(); ingestDataDaProxy.SaveTestData(checkedMsg); InProcFactory.CloseProxy(ingestDataDaProxy); } else { Debug.Assert(checkedMsg.IsValid); LogInvalidMessageError(checkedMsg); } }