Esb toolkit 2.1 将ESB toolkit的FaultMessage对象发送到ESB门户上的dispaly错误消息
我试图使用下面的代码将虚拟错误消息从.net类库发送到ESB管理门户。已使用ESB ExceptionHandling服务提供的WCF服务并创建了该服务的客户端Esb toolkit 2.1 将ESB toolkit的FaultMessage对象发送到ESB门户上的dispaly错误消息,esb-toolkit-2.1,Esb Toolkit 2.1,我试图使用下面的代码将虚拟错误消息从.net类库发送到ESB管理门户。已使用ESB ExceptionHandling服务提供的WCF服务并创建了该服务的客户端 ExceptionHandlingClient clientESB = new ExceptionHandlingClient(); FaultMessage faultMsg = new FaultMessage(); faultMsg.
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);
执行上述代码时,它会成功设置FaultMessage对象的属性。此请求在到达所有异常发送端口时失败,并显示以下错误消息
执行发送管道时失败:“Microsoft.Practices.ESB.ExceptionHandling.Pipelines.ESBFaultProcessor,Microsoft.Practices.ESB.ExceptionHandling.Pipelines,Version=2.1.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”源:“ESB BAM Tracker”发送端口:“ALL.Exceptions”URI:“SQL://(本地)/ESBEExceptionDB/”原因:发生意外的文件结尾。以下元素未关闭:ns0:FaultMessage。第20行,位置12
如果要从BizTalk业务流程发送异常消息,则可以在创建Microsoft.Practices.ESB.ExceptionHandling.Schemas.Faults.FaultMessage类型的faultMsg的构造形状中执行以下操作
faultMsg = Microsoft.Practices.ESB.ExceptionHandling.ExceptionMgmt.CreateFaultMessage();
faultMsg.FailureCategory = "Failure Category";
faultMsg.FaultCode = "Fault Code";
faultMsg.FaultSeverity = Microsoft.Practices.ESB.ExceptionHandling.FaultSeverity.Error;
faultMsg.FaultDescription = "Fault Description";
faultMsg.Scope = "Fault Message Scope";
注意:
Microsoft.Practices.ESB.Exception.Management
Microsoft.Practices.ESB.ExceptionHandling
Microsoft.Practices.ESB.ExceptionHandling.Schemas.Faults
如果要从BizTalk业务流程发送异常消息,则可以在创建Microsoft.Practices.ESB.ExceptionHandling.Schemas.Faults.FaultMessage类型的faultMsg的构造形状中执行以下操作
faultMsg = Microsoft.Practices.ESB.ExceptionHandling.ExceptionMgmt.CreateFaultMessage();
faultMsg.FailureCategory = "Failure Category";
faultMsg.FaultCode = "Fault Code";
faultMsg.FaultSeverity = Microsoft.Practices.ESB.ExceptionHandling.FaultSeverity.Error;
faultMsg.FaultDescription = "Fault Description";
faultMsg.Scope = "Fault Message Scope";
注意:
Microsoft.Practices.ESB.Exception.Management
Microsoft.Practices.ESB.ExceptionHandling
Microsoft.Practices.ESB.ExceptionHandling.Schemas.Faults
这是在使用BizTalk吗?如果是这样,您可能希望添加biztalk标记以及相应的biztalk版本标记。在从测试客户端发送之前,您可能需要在faultMsg上使用XmlSerializer?我在下面添加了一个关于如何从BizTalk业务流程发送错误消息的答案,该错误消息也可能会在使用BizTalk时给出一些提示?如果是这样,您可能希望添加biztalk标记以及相应的biztalk版本标记。在从测试客户端发送之前,您可能需要在faultMsg上使用XmlSerializer?我在下面添加了一个关于如何从BizTalk业务流程发送错误消息的答案,这也可能提供一些线索