Book Image

SOA Patterns with BizTalk Server 2013 and Microsoft Azure

By : Richard Seroter, Mark T Brimble, Coen J Dijkgraaf, Mahindra Morar, Mark Brimble, Colin Dijkgraaf, Johann Cooper
Book Image

SOA Patterns with BizTalk Server 2013 and Microsoft Azure

By: Richard Seroter, Mark T Brimble, Coen J Dijkgraaf, Mahindra Morar, Mark Brimble, Colin Dijkgraaf, Johann Cooper

Overview of this book

Table of Contents (21 chapters)
SOA Patterns with BizTalk Server 2013 and Microsoft Azure Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

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...