ESB Exception Handling in Orchestration

In Orchestration when there is requirement is that all the exception should be logged into ESB Management Portal or ESB Exception Database, then we need to add some code in orchestration catch block to send exception to ESB Exception Db and Management Portal.

BizTalk Server Monitoring

We need to follow the below process to send exception details to BizTalk ESB

  1. Firstly we need to add bellow dlls in reference of the project. you can get these dlls in GAC

2. Add exception massage in orchestration with  Message Type           Microsoft.Practices.ESB.ExceptionHandling.Schemas.Faults.FaultMessage     


3.  In catch block create a message Assignment shape and write below code

ExceptionMsg = Microsoft.Practices.ESB.ExceptionHandling.ExceptionMgmt.CreateFaultMessage();

ExceptionMsg.FailureCategory = “SystemException”;

ExceptionMsg.FaultSeverity =  Microsoft.Practices.ESB.ExceptionHandling.FaultSeverity.Error;

ExceptionMsg.FaultCode =”1″;

ExceptionMsg.FaultDescription = systemException.Message.ToString(); 

Microsoft.Practices.ESB.ExceptionHandling.ExceptionMgmt.AddMessage(ExceptionMsg, ReceiveMsg);


You can change the message description according Business requirement. In last line AddMessage function contains Exception message first and then provide that message which you want to get from ESB Portal.

4. Create a Correlation type and corresponding correlation set with below property assign in correlation type:

  • Practices.ESB.ExceptionHandling.Schemas.Property.Application
  • Practices.ESB.ExceptionHandling.Schemas.Property.FaultCode

5. Define Correlation Sets


6. Create a send port and assign exception message and initiate correlation set as define above. SendPortConfiguration.jpg

    7. Port Configuration should always be direct binding for this send port. As below                  screenshot.


Now build and deploy the application.

BizTalk Server Monitoring

7 responses to “ESB Exception Handling in Orchestration”

Leave a Reply

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

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

Facebook photo

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

Connecting to %s

Blog at

%d bloggers like this: