public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(IPipelineContext context, IBaseMessage msg, string resolverString, IItineraryStep step) { var callToken = TraceProvider.Logger.TraceIn(this.Name); try { bool IsDirectSynchronousACK = GetConfigValue <bool>(step.PropertyBag, "isDirectSynchronousACK", false); BTS.RouteDirectToTP rdttp = new BTS.RouteDirectToTP(); if (IsDirectSynchronousACK) { msg.Context.Promote(rdttp.Name.Name, rdttp.Name.Namespace, true); } else { msg.Context.Promote(rdttp.Name.Name, rdttp.Name.Namespace, false); } return(msg); } catch (Exception ex) { // put component name as a source information in this exception, // so the event log in message could reflect this ex.Source = this.Name; TraceProvider.Logger.TraceError(ex); throw ex; } finally { TraceProvider.Logger.TraceOut(callToken, this.Name); } }
/// <summary> /// Send request message back to caller as response /// </summary> /// <param name="pipelineContext">Pipeline context</param> /// <param name="inputMessage">Input message</param> /// <returns>Original input message</returns> protected override IBaseMessage Execute(IPipelineContext pipelineContext, IBaseMessage inputMessage) { if (inputMessage.BodyPart != null) { TraceProvider.Logger.TraceInfo("Routing inbound request message back to sender"); BTS.RouteDirectToTP RouteDirectToTP = new BTS.RouteDirectToTP(); BTS.IsRequestResponse IsRequestResponse = new BTS.IsRequestResponse(); inputMessage.Context.Promote(RouteDirectToTP.Name.Name, RouteDirectToTP.Name.Namespace, true); inputMessage.Context.Promote(IsRequestResponse.Name.Name, IsRequestResponse.Name.Namespace, true); } else { TraceProvider.Logger.TraceInfo("Message has no body part, exiting"); } // return original message return(inputMessage); }