Introduction

This sample project is a new version of the Map TestTool that calls a custom MapHelper class directly from .NET. Now you can test a BizTalk 2013 map with multiple input messages and the MapTester tool is no longer
dependent on the ESB Toolkit.

 

Changes v1.1

Sander Nefs, a fellow integration specialist has added the AssemblyPicker
feature to pick the name of the Map from a BizTalk Assembly.
http://snefs.blogspot.nl/


What's New For This Release
- AssemblyPicker

 

Changes v1.0

The following changes are made:

 

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”.

 

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.

 

Enter the Source file and the fully qualified name of the map and click on Test Map

 

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.

 

View detailed exception information in the info screen.

 

 

How the sample works

 Code example to call the custom MapHelper class and how to measure the execution time of the map.

C#
Edit|Remove
System.Xml.XmlDocument sourceDoc = new System.Xml.XmlDocument(); 
sourceDoc.Load(SourceBrowser.Url.ToString()); 
 
// Fully qualified name of the map deployed in BizTalk. 
string mapName = string.Format("{0},{1}", TestSettings.Name, TestSettings.Assembly);                 
 
string result = nullstring docSpec = nullstring messageType = null; 
 
// Measure Start 
long startTick = DateTime.Now.Ticks;                  
 
/*  
This method takes as parameters a string that contains the message to transform and a string that contains the fully qualified name of a map deployed in BizTalk. The method returns a stream containing the transformed document. 
*/ 
using (Stream stream = MapHelper.TransformMessageStream(sourceDoc.InnerXml, mapName, falseref docSpec, ref messageType)) 
{ 
    using (StreamReader reader = new StreamReader(stream)) 
    { 
        result = reader.ReadToEnd(); 
    } 
} 
 
// Measure End 
long endTick = DateTime.Now.Ticks; 
long tick = endTick - startTick; 
long milliseconds = tick / TimeSpan.TicksPerMillisecond;

  

More Information

For more information on execute a BizTalk map from .NET, see:
http://www.ithero.nl/post/2013/05/05/New-version-of-the-Map-TestTool-Execute-a-BizTalk-2013-map-with-multiple-input-messages.aspx