Archive | BizTalk RSS for this section

Conditional Port Deployment Using the Deployment Framework for BizTalk (BTDF)

Using the Deployment Framework for BizTalk  makes the normally painful task of performing a BizTalk deployment a lot easier. If you don’t know about it, I’d highly recommend taking a look into it. Once you get it going, you’ll find there’s no better way to do a BTS deployment.

Oftentimes while doing BizTalk work, I like to create “test ports” to help me unit test my BizTalk code or configuration. These are usually file-drop locations that I don’t want included in my regular deployment. I’ve found it to be somewhat painful a process to continually have to either add or remove these test locations, so I like to use the Deployment Framework’s capability to use XML Preprocess to selectively deploy a port.

Here’s how:

First, you’ll need to make sure the value of the RequireXmlPreprocessDirectives is set to “True” in the deployment project file. Then, in the PortBindingsMaster file, you simply comment out the port you want to be conditional and wrap it in a preprocessor directive like such:

<!-- ifdef ${_xml_preprocess} -->    
<!-- <ReceivePort Name="TEST" IsTwoWay="false" BindingOption="0">
      <Description xsi:nil="true" />
      <ReceiveLocation Name="TEST_FILE">
          <Description xsi:nil="true" />
      </ReceivePort> -->
<!-- endif -->

When you need to turn it off, you simply change the value of RequireXmlPreprocessDirectives to “False” and BTDF will treat your port definition as it would any other commented out code-it’ll ignore it.

One caveat to this approach, though, is that you’ll need to wrap ALL other variable-based definitions in the PortBindingsMaster with preprocessor directives as such:

<!-- ifdef ${_xml_preprocess} -->
<!-- <Address>mssql://${dbServerName}//${dbName}?</Address>-->
<!-- else -->
<!-- endif -->

Note that the “else” part isn’t commented out. That’s so that if the preprocessor is off, it will recognize it as normal text and BTDF will process accordingly.  Also notice that the “Address” part is identical. This is because I wanted it to work the same way regardless of whether we were going to require the preprocess directive or not. If I wanted to do something different I would simply change these values.

Biztalk NoS

BizTalk MVP, Nino Crudele developed a great tool for developing and testing BizTalk components, BizTalk NoS.

Features include

  • Quick search inside artifacts
  • Fast register/unregister in the GAC
  • Find critical internal or external dependencies
  • Jackhammering:  compare your Visual Studio artifacts with those deployed in the BizTalk environment
  • Extract artifacts from a BizTalk environment and put it in a Visual Studio solution
  • Test your pipeline in Visual Studio

It’s one of those things where you say, “Why didn’t someone think of this sooner?”

Finally someone did. It’s awesome and you need it. Like now. Go get it. Right now:

And also follow Nino’s blog here.

%d bloggers like this: