I am trying to send the dummy fault message from .net class library to ESB management portal using below code. Already consumed WCF service provided by ESB ExceptionHandling Service and created client of it.
ExceptionHandlingClient clientESB = new ExceptionHandlingClient();
FaultMessage faultMsg = new FaultMessage();
faultMsg.Header = new FaultMessageHeader();
faultMsg.Header.Application = "Exception Handling Service Test";
faultMsg.Header.Description = "Fault Message Header";
faultMsg.Header.ErrorType = "Error Type";
faultMsg.Header.FaultSeverity = 1;
faultMsg.Header.FaultCode = "Fault Code";
faultMsg.Header.FailureCategory = "Failure Category";
faultMsg.Header.FaultDescription = "Fault Description";
faultMsg.Header.FaultGenerator = "Fault Generator";
faultMsg.Header.Scope = "Fault Message Scopte";
faultMsg.Header.ServiceInstanceID = System.Guid.NewGuid().ToString();
faultMsg.Header.ServiceName = "Exception Service";
faultMsg.Header.MachineName = System.Environment.MachineName;
faultMsg.Header.DateTime = System.DateTime.Now.ToString();
faultMsg.Header.ControlBit = "1";
faultMsg.Header.MessageID = System.Guid.NewGuid().ToString();
faultMsg.Header.ActivityIdentity = "Activity Identity ";
faultMsg.Header.NACK = false;
//Use the 'client' variable to call operations on the service.
clientESB.Open();
clientESB.SubmitFault(faultMsg);
When above code executes, it sets properties of FaultMessage object successfully. This request when reaches to ALL.Exceptions send port it fails with below error message.
There was a failure executing the send pipeline: "Microsoft.Practices.ESB.ExceptionHandling.Pipelines.ESBFaultProcessor, Microsoft.Practices.ESB.ExceptionHandling.Pipelines, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "ESB BAM Tracker" Send Port: "ALL.Exceptions" URI: "SQL://(local)/EsbExceptionDb/" Reason: Unexpected end of file has occurred. The following elements are not closed: ns0:FaultMessage. Line 20, position 12.
If you are sending an Exception Message from a BizTalk Orchestration you can do the following in a Construct Shape that creates a faultMsg of type Microsoft.Practices.ESB.ExceptionHandling.Schemas.Faults.FaultMessage
Note:
Microsoft.Practices.ESB.Exception.Management
Microsoft.Practices.ESB.ExceptionHandling
Microsoft.Practices.ESB.ExceptionHandling.Schemas.Faults