Pipeline to publish a typed message
In some circumstances, it may be necessary to publish a typed message to the message box when receiving a message using the HTTP GET or DELETE verbs. As you know, there is no message body to publish, therefore we need to create one in the receive pipeline. More information about how to develop custom pipelines can be found at https://msdn.microsoft.com/en-us/library/aa548050.aspx.
In the disassemble stage of the receive pipeline, we inspect the value of the InboundHttpMethod
property; if it is a GET method, we call the helper method ResourceLocationBasedMsg
to instantiate a message and populate the promoted elements:
public void Disassemble(IPipelineContext pContext, IBaseMessage pInMsg) { IBaseMessageContext context = pInMsg.Context; //Get the http verb from the context properties var httpVerb = context.Read("InboundHttpMethod", "http://schemas.microsoft.com/BizTalk/2006/01/Adapters/WCF-properties"); //Check if the method is a GET if(httpVerb.Equals...