Register Wcf Custom Behavior in BizTalk itself

All those who work with Microsoft BizTalk Server are already aware what custom behavior is. There may be a WCF scenario where BizTalk would require us to write a functionality which overcomes the limitation of BizTalk WCF adapter.

Below is one such scenario where we had a requirement to enable TLS 1.2 while sending the message using WCF adapter.

I will not be creating a Custom behavior rather we will try to register that behavior in BizTalk itself so that it can be used at the port level.

custombehavior

Usually when we try to register the WCF custom behavior we add it to the machine.config file at below file location –

  • C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config
  • C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config

behavior1.png

The drawback with this approach is that – adding the configuration to the machine.config works but may not be a good idea as you have to reboot the server for the changes to be recognized. Doing it in Production environment may not sound good.

Let’s see how can we register in BizTalk itself. Only when using the below adapters, you can register WCF extensions in BizTalk itself.

  • WCF-Custom
  • WCF-WebHttp

Navigate to the WCF-Custom/WCF-WebHttp adapter handlers.

behavior2.png

Click the Send Handler and select Properties tab.

behavior5.png

Import your ImportWcfExtensions.config that contains your WCF extensions.

CustomConfig

behavior3.png

Once you have imported the WCF Extension, you can navigate to your Send Port and Add the custom behaviour extension to your port.

behavior6

Click on Add extension and you may now see your custom behavior

custombehavior

You can only use WCF Extensions against WCF-Custom and WCF-Webhttp adapters. In other cases you still need to add it to the machine configuration. Since you add this extension to the Adapter handler it influences other application.

Advertisements

2 comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s