ESB Itinerary Samples

When we start working on itinerary then most of time we struggle with how to do development of ESB Itinerary and search out several blogs or website.

But we forgot that when ESB toolkit installs on BizTalk Server then Microsoft also provides several samples of How to use ESB itinerary in different conditions.

At C:\Program Files (x86)\Microsoft BizTalk ESB Toolkit location one ESBSource zip file is available.

You need to extract the zip file under C:\Projects folder, if not available then create this folder. And at below location you can get sample project GlobalBank.ESB.Samples.Itinerary at C:\Projects\ESBSource\Source\Samples\Itinerary location.

In this project there are defined several kinds of ESB Itinerary sample scenario. You can take help of this project to build or create new itinerary.

ESB Tracking Log:

When we are developing ESB Itinerary, then sometimes we are not able to reach out where exception occur in Itinerary. Debugview tool is provided by below website. You can download this tool and run that to get ESB log to track the ESB Itinerary Steps.

Also you need to do small addition in machine config file as below:

  1. openC:\Windows\Microsoft.NET\Framework\v4.0.30319\CONFIG\machine.config for 32-bit
    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\CONFIG\machine.config for 64-bit
  2. Locate the line with the closing configSections tag.
  3. Under that line paste the following section:



          <add name=”BizTalkESBToolkit” value=”4″/>   



4. Save and close machine.config.

5. In DebugView, on the Capture menu, click Capture Global Win32 to make sure that            it is checked.

6. Restart the BizTalk host instances.

Below are some links where you can get more information about Itinerary details:


ESB Request Response:

ESB For multiple Subscriber:

ESB Wiki







ESB Itinerary in Orchestration

Sometimes orchestration need to involve in ESB itinerary to achieve business complexity and making more loosely coupled solution.

Here in below sample project, I provide solution for how to de-batch incoming message and applying mapping then sends to send port.

We can directly de-batch incoming message in ESBSelectReceiveXML pipeline on receive port without use of orchestration. But if we involve mapping on document schema also after de-batching then we need to introduce Orchestration extender in ESB Itinerary to implement mapping resolver otherwise it will through exception.


Reference Dlls in BizTalk Solution for ESB implementation in Orchestration:

  • C:\Program Files (x86)\Microsoft BizTalk ESB Toolkit\Bin\Microsoft.Practices.ESB.Itinerary.dll
  • C:\Program Files (x86)\Microsoft BizTalk ESB Toolkit\Bin\Microsoft.Practices.ESB.Itinerary.Schemas.dll
  • C:\Program Files (x86)\Microsoft BizTalk ESB Toolkit\Bin\Microsoft.Practices.ESB.Resolver.dll
  • C:\Program Files (x86)\Microsoft BizTalk ESB Toolkit\Bin\Microsoft.Practices.ESB.Resolver.Container.dll


  • Envelop Schema:



  • Document Schema


  • Destination Schema:


Map: Document Schema to Destination Schema






Note: In case of orchestration extender, we need to set up receive and send message in System.Xml.XmlDocument format. It will not work with specific schema format. After receiving the xml doc in orchestration you can assign the xml document to specific schema and define the work flow and when you need to send back message to ESB itinerary then also you need to convert into in System.Xml.XmlDocument format then send.

Orchestration configuration:

  1. Binding type should be direct for Logical Receive/Send port, which are connect to ESB Itinerary.

Note: when one orchestration used in Itinerary then you should use Request/Response Port. When you need to use multiple orchestration in Itinerary then you can use separate Receive and send port.

  1. Orchestration Receive Filter:


3. Next in expression shape: Define ESB Itinerary objects as below:

itinerary = new Microsoft.Practices.ESB.Itinerary.SerializableItineraryWrapper();

itineraryStep = new Microsoft.Practices.ESB.Itinerary.SerializableItineraryStepWrapper();

itinerary.Itinerary = Microsoft.Practices.ESB.Itinerary.ItineraryOMFactory.Create(InboundMsg);

itineraryStep.ItineraryStep = itinerary.Itinerary.GetItineraryStep(InboundMsg);

  1. Define Resolver if used in Orchestration Extender:

ResolverCollection = itineraryStep.ItineraryStep.ResolverCollection;


ResolverDictionaryString = ResolverCollection.Current;

  1. All below variable need to create in variable section in Orchestration view as below:


Variable Variable Definition
itinerary Microsoft.Practices.ESB.Itinerary.SerializableItineraryWrapper
itineraryStep Microsoft.Practices.ESB.Itinerary.SerializableItineraryStepWrapper
ResolverCollection Microsoft.Practices.ESB.Itinerary.ResolverCollection
ResolverDictionary Microsoft.Practices.ESB.Resolver.ResolverDictionary
XMLDocument System.Xml.XmlDocument

Other variables are in System.String format.

  1. In MessageAssignment shape following code should be written, Here Resolver Service is executed. Resolver service can be change and update on business requirement basis. Here Static transformation (Mapping) is used ( Resolver defined in ESB Itinerary):

ResolverDictionary = Microsoft.Practices.ESB.Resolver.ResolverMgr.Resolve(InboundMsg, ResolverDictionaryString);

mapName= ResolverDictionary.Item(“Resolver.TransformType”);

XMLDocument = InboundMsg;

ResponseString = Microsoft.Practices.ESB.Transform.MapHelper.TransformMessage(XMLDocument.OuterXml,mapName);


OutboundMsg = XMLDocument;

OutboundMsg(*) = InboundMsg(*);

//Below code for sending to next itinerary step



  1. Create Send port to send the OutboundMsg On Send port correlation set also need to initialize as per below
  2. Correlation set and correlation type also need to set up, because direct binding used on Receive/Send Port. Correlation need to be initialize on send port.

Below correlation type need to setup for Request/Response port.


One more correlation type for ESB Itinerary:


  1. Now deploy this Solution and add the ESB config file

Note: If there is require exception handling also in orchestration in ESB management console then

Go to following link:

ESB Config File:

Insert orchestration details in ESB config file located at C:\Program Files (x86)\Microsoft BizTalk ESB Toolkit\esb.config

So that it will be available in ESB Itinerary as orchestration extender.

Open ESB.Config file which in the ESB Toolkit installation folder and add configurations as below under “ItineraryServices”. Below details need to fill in config file.

  • Type: Orchestration dll info
  • Name: Orchestration Name (Name can be change, Whatever name is providing here, same need to apply on Receive Shape filter in orchestration and same name publish in Service Name in Orchestration Extender in ESB Itinerary)
  • Stage: None
  • Scope: Orchestration
  • Id: GUID


Note: This config file only need to update in development environment because ESB Itinerary need to set up. When we deploy in UAT or Production Server then It not require updating the esb.config file because ESB itinerary directly get details from database.

BizTalk Configuration on Admin Console:

  1. Create Receive Location and assign the ItinerarySelectReceiveXml pipeline for that.

Below configuration need to setup in this pipeline property.

If in your BizTalk admin console there are several applications use similar kind of schema then you can provide EnvelopeSpecName and DocumentSpecName to not get any exception. More details you can get here

  1. Create Send Port with having following filter:


Here Microsoft.Practices.ESB.Itinerary.Schemas.ServiceName is define the Itinerary name.

ESB Itinerary Configuration:

  • Create a ESB Itinerary file
  • Set OnRamp with BizTalk application


  • Create Itinerary Server as orchestration Extender and Orchestration name in Service Name property as below:


  • Define Resolver which is expecting to define in Orchestration


  • Define off Ramp as below:


  • Define OffRamp Extender and Resolver as below



Now export this itinerary and deploy BizTalk application and test. Good luck