Consider the following scenario:
- You need to receive a message into BizTalk Server, and send an acknowledgement back to the sender (probably using a Request-Response port).
- The response is trivial, it’s similar to a void response in WCF, or containing only information that can be obtained from the request message (such as an ID or something).
The figure below displays this scenario graphically:
BizTalk Server doesn’t allow that easily out of the box, because there’s no standard way to create a response and correlate it to the request without involving an orchestration or a solicit-response port.
In comes the context property RouteDirectToTP
. If you set this property on the inbound request with value true
, the BizTalk Messaging Engine will route the request immediately back to the receive port (actually, it routes it back to any instance subscription with the matching EpmRRCorrelationToken. This post explains why
. In the above scenario, the receive port has such an instance subscription). Since the receive port has an outbound map, that transforms the request to response, the sender will receive the response message.
In the above sample, the context property is set using a ContextManipulator pipeline component, which can manipulate context properties based on xml configuration. This xml configuration looks like this:
<cmc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
The ContextManipulator pipeline component allows to add, remove, map, change, promote and demote context properties.
Below a screenshot of using the WCF Test Client to receive a response using the above sample:
You can download the sample from my skydrive. It includes the sources for the ContextManipulator pipeline component.