Last year I created a sample tool to execute or test BizTalk maps. (See the post: Execute a BizTalk 2010 map from .NET) The sample was downloaded over 300 times so I thought maybe it would be nice to add some features to the tool and port it to BizTalk 2013!

The following changes are made:

  • The sample project ported to the .NET framework 4.5 with Visual Studio 2012.
    BizTalk 2010 uses System.Xml.Xsl.XslTransform to transform a message. BizTalk 2013 uses the XslCompiledTransform class that significantly outperforms the XslTransform class.
           
  • A new wizard to create an envelope message to wrap multiple input messages.
    In the old version you also can test a map with multiple input messages but it’s not very easy because when you create a transformation map with multiple source documents, BizTalk uses an envelope to wrap the individual input messages. When you want to test the map you have to create the envelope manually or generate the envelope in Visual Studio. Then you still need to adjust the envelope because Visual Studio cannot create an envelope with real data from multiple input messages.
         
  • Custom MapHelper class to perform BizTalk transformations directly from .NET.
    In old version a reference was added to the ESB.TransformServices.dll assembly, which contains the classes required to call a BizTalk map. I’ve extracted the code with Reflector and created a custom MapHelper class to perform BizTalk transformations directly. Now the MapTester tool is no longer dependent on the ESB Toolkit.
        
  • Measure the execution time of the map.
    Elapsed time in milliseconds.
        
  • User experience changes.
    Some small changes in the user interaction.

 

Using the tool

Follow the next steps to test a map with real data from multiple input messages:

Click in the File menu on the menu item “Create envelope with multiple input messages”.
CreateEnvelope
 
In the Wizard pop-up click on the “Add File” button to select a XML file to add to the envelope. You can select multiple input messages. Click on “Finish” to create the envelope.
MultipleInputMessagesWizard
 
Enter the filename of the envelope in the “Save As” pop-up and click on the “Save” button.
SaveAs
 
Enter the fully qualified name of the map and click on the “Test Map” button to test the map.
BizTalk2013_MapTester_SourceFile
 
In the Result tab is the transformed message shown. In the Info screen is the execution time shown and the name of the transformed file.
BizTalk2013_MapTester_TransformedFile
 

Conclusion

It is always nice to create something that is really used so I hope that the new version is also going to be downloaded many times!  ;-) If you have suggestions or a remark please comment!

Note:
The sample is designed for BizTalk 2013 but if you want to use it for BizTalk 2010 you can change the target framework and remove the custom MapHelper class that performs the BizTalk transformations. Add a reference again to the ESB.TransformServices.dll assembly from the ESB Toolkit and use these classes to call a BizTalk map.

You can download the sample tool with the source code here:
Execute a BizTalk 2013 map with multiple input messages from .NET