Simple BizTalk ESB 2.0 Exception Handling

July 1st, 2010  |  Published in BizTalk Tips  |  1 Comment

This has been blogged several times earlier. I am recording this for my reference.

Steps to setup basic ESB 2.0 Exception Handling in an orchestration

  1. Create Multipart message type “Fault” with “Body” of type Microsoft.Practices.ESB.ExceptionHandling.Schemas.Faults.FaultMessage
  2. Create new message msgFault with above type
  3. Create Exception Handler sysEx of type System.SystemException
  4. Construct message with following expressions:

 

//Create Fault Exception Message

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

//Set Fault Properties

msgFault.Body.FailureCategory = “Category of failure“;

msgFault.Body.FaultCode = “ERROR“;

msgFault.Body.FaultDescription = sysEx.Message;

msgFault.Body.FaultSeverity = Microsoft.Practices.ESB.ExceptionHandling.FaultSeverity.Error;

//Add Message to the Fault Message

Microsoft.Practices.ESB.ExceptionHandling.ExceptionMgmt.AddMessage(msgFault, MessageCreatedOutsideScope);

References to be added:

Microsoft.Practices.ESB.ExceptionHandling

Microsoft.Practices.ESB.ExceptionHandling.Schemas.Faults

Responses

  1. BizTalk Lnks from Other blogs « Tenalinaga's Blog says:

    November 27th, 2010 at 7:21 pm (#)

    […] BizTalk ESB Exception Handling BizTalk ← WCF Services Failure with Exception message: The authentication scheme ‘“Negotiate’ is not supported. BizTalk 2010 Intergration with Oracle E-Business Suite → LikeBe the first to like this post. […]

Leave a Response

You must be logged in to post a comment.