This post was originally published here
Unfortunately, some good BizTalk Server resources have disappeared over these years, and they are no longer available. A lot of these resources are custom adapters. One of these adapters was the BizTalk WCF Loopback Adapter initially developed by synthesis consulting (I think), providing back then the source code.
What is the WCF-Loopback Adapter?
The Loopback adapter is simply a two-way send adapter that, in its essence, returns a copy of the outbound message. This capability can be used in several situations or scenarios:
- One of them is to replace the need to call pipelines inside an orchestration. Calling pipelines inside orchestrations is a good option, but it complicates the logic of the orchestrations with loops and expressions. You’ll also end up repeating the “code” for each message type/orchestration.
- Atin Agarwal described another example in his blog: Simulating LOB Application using WCF LoopBack Adapter Binding in BizTalk.
The Loopback adapter gives you two opportunities:
- To execute pipeline and maps on the way out
- And when it comes back in without the overhead of some repository.
I was recently doing a proof-of-concept at a client, and I needed to invoke a receive pipeline inside the orchestration. That approach worked fine, but it feels like a static black hole that you don’t know is there, and if there is a need to apply any changes, you need to redeploy the orchestration. You cannot simply modify a setting on the pipeline. So, I decide to use the Loopback adapter to recreate the same experience implementing a different approach. Unfortunately, this adapter was no longer available for download, and all the references were wiped out from the face of the Earth. Luckily, I had some old print screens on my vast list of internal resources, and I decided to create a new version of this WCF adapter (king of re-creating) and make this WCF adapter available again.
It was also a good training experience to create a WCF Adapter.
How to install it?
This is a WCF adapter, so installing this adapter is the same as installing any other BizTalk Server WCF extension. And you have two options:
- Using the machine.config files – This is the most complicated option, but it is the one I prefer to use;;
- Or using the availability of registring WCF extensions on the receive and send handlers will not explain this approach.
You can choose to register this WCF adapter to run under 32-bit host instances, 64-bit host instances, or of course, both.
To install it, you need to:
- Download the runtime folder from the WCF-Loopback Adapter GitHub page.
- Install/register the Microsoft.BizTalk.WCFLoopback.Adapter.Runtime.dll in GAC
- And add these settings of the machine.config files:
<system.serviceModel> <extensions> <bindingElementExtensions> <add name="WCFLoopbackAdapter" type="Microsoft.BizTalk.WCFLoopback.WCFLoopbackAdapterBindingElementExtension, Microsoft.BizTalk.WCFLoopback.Adapter.Runtime, Version=22.214.171.124, Culture=neutral, PublicKeyToken=5c92120f39ef9d11" /> </bindingElementExtensions> <bindingExtensions> <add name="WCFLoopbackAdapterBinding" type="Microsoft.BizTalk.WCFLoopback.WCFLoopbackAdapterBindingCollectionElement, Microsoft.BizTalk.WCFLoopback.Adapter.Runtime, Version=126.96.36.199, Culture=neutral, PublicKeyToken=5c92120f39ef9d11" /> </bindingExtensions> </extensions> </system.serviceModel>
- To run under 32-bit host instances
- Open the machine.config present on the folder: C:WindowsMicrosoft.NETFrameworkv4.0.30319Config
- I will also recomend, not mandatory, to change also the machine.config present on the folder: C:WindowsMicrosoft.NETFrameworkv2.0.50727CONFIG
- To run under 64-bit host instances
- Open the machine.config present on the folder: C:WindowsMicrosoft.NETFramework64v4.0.30319Config
- I will also recomend, not mandatory, to change also the machine.config present on the folder: C:WindowsMicrosoft.NETFramework64v2.0.50727CONFIG
Restart the services.
Where can you use it?
This version available on GitHub is currently compiled on .NET 4.7.2 and optimized for BizTalk Server 2020. Nevertheless, you can take this code and compile it in other versions of .NET and BizTalk Server. It will be 100% compatible.
THIS ADAPTER IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND.
You can download the BizTalk Server WCF-Loopback Adapter from GitHub here:
The post BizTalk Server WCF-Loopback Adapter appeared first on SANDRO PEREIRA BIZTALK BLOG.