(or how to do asynchronous processing of a synchronous request/response message)[Note: this post follows on from my previous post How to validate Xml Documents against schemas in BizTalk. For example, if you validate a message in a pipeline and validation fails, how do you send a response back to a waiting web service client.]For a while now, people have been struggling with how to asynchronously process request/response messages - basically, how to get away from having a request/response port in an orchestration bound to a request/response receive location.For example, Yossi Dohan blogged on this a while back, and came up with a solution involving multiple orchestrations:http://www.sabratech.co.uk/blogs/yossidahan/2006/06/sync-to-async-conversion.htmlThe problem revolves around the fact that BizTalk will always demote the EpmRRCorrelationToken context property when your message leaves the orchestration if you try and manually set it yourself.There is a way around this, but it does involve you writing some code.In fact, it involves writing a custom adapter and/or pipeline component. This is how we solved it at one of my clients.The trick is to promote the property outside of the orchestration – and that can only be done in a send pipeline or send adapter.If you're not up to writing your own adapter, you can use the loopback adapter and a custom pipeline component.What you have to do is promote the EpmRRCorrelationToken context property in your pipeline or your adapter.Which means that with a custom pipeline/adapter, you can asynchronously process request/response messages without even needing orchestrations (e.g. in high-perf situations where you can do everything in pipelines).The code to promote the property is very simple.First of all (for those of you who haven't come across this), let's explain the issue (skip this and go to after the primer if you wish):<Begin Primer>
EpmRRCorrelationTokenRouteDirectToTP
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.