使用未构造的消息 [英] Use of unconstructed message

查看:75
本文介绍了使用未构造的消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用BizTalk 2004

I am using BizTalk 2004

我有一个业务流程,该业务流程具有异常块,该异常块会在遇到异常之前将其创建的实际日志文件发送出去.

I have an orchestration that has exception block that sends out the actual log file it is creating before it hit an exception.

这是设计: 我的日志文件消息可能包含几个记录实例,例如:(我在节点中添加了-",以便您可以看到示例)

here is the design: My log file message may contain several record instances, say: (I added "-" in the nodes so you can see the sample)

< -log> <-记录> < -node1/> < -node2/> <-/记录> <-记录> < -node1/> < -node2/> <-/记录> <-/log>

<-log> <-record> <-node1 /> <-node2 /> <-/record> <-record> <-node1 /> <-node2 /> <-/record> <-/log>

我在长期运行的事务"中拥有一个总体范围,并且具有捕获System.Exception的异常块 范围内是包含多个记录的我的请求消息的整体处理.日志文件最初仅用标头(log)构建,然后在循环中更新记录文件,在日志循环中,日志文件从请求中获取记录,并单独处理为单个xml.它将遍历每个单独的xml,然后将记录添加到日志文件中.

I have an overall scope in Long Running Transaction with an exception block that catches System.Exception Inside the scope is the overall processing of my request message containing several records. The log file is initially constructed with just the header (log), then the log file is updated in a loop for the records, wherein it gets the records from the request which is processed individually to a single xml. It will loop through each individual xml, then adds the record in the log file.

此构造的日志文件在循环处理后被成功发送出去.现在,我想发送在遇到异常时构造的日志文件.正如我所说,日志文件正在循环中进行更新和构建.但是,当我尝试在异常块内发送日志文件时,我遇到了使用未构造的消息"的问题,因此我尝试将日志文件保存在xmldocument中,然后使用xmldocument在异常块内构造消息,但是我有了xmlDocument本身的使用未构造的消息"

this constructed log file is being sent out successfully after the loop processing. Now I want to send the log file constructed when an exception is hit. As I said, the log file is being updated and constructed in the loop. but when I tried sending the log file inside the exception block, I hit the "Use of Unconstructed Message" thing, so I tried saving the log file in an xmldocument then construct the message inside the exception block with the xmldocument, but I then have the "Use of unconstructed Message" thing for the xmlDocument itself

如果可以告诉我如何在长时间运行的事务范围内成功地将日志文件发送到异常块内,将不胜感激.

If you can show me how I can successfully send the log file inside the exception block in a long running transaction scope will be greatly appreciated.

提前谢谢!

推荐答案

如果我正确理解了您的描述,那么问题是您正在作用域中创建一条消息,然后您希望将该消息用于相同的异常处理程序中范围. 就编译器而言,不能保证在引发异常之前就可以构造消息,在这种情况下,异常处理程序可以在未构造消息的情况下执行. 如果在消息构造形状之前或之后出现作用域失败,则会发生这种情况.

If I understand your description correctly the problem is that you are creating a message in the scope, which you then wish to use in the exception handler of the very same scope. As far as the compiler is concerns, there cannot be any guarantees that the message would be constructed before an exception is thrown, in which case the exception handler may execute with the message being unconstructed. This will happen if you have a failure in the scope before, or at, the message construct shape.

要解决此问题,必须首先在其异常处理程序使用该消息的作用域之前构造消息.然后,您可以在范围内重新构造形状,但这可以确保在碰到异常处理程序时,一条消息会以一种或另一种方式存在.

To solve this you must construct the message initially before the scope whose exception handler uses the message. you can then go and re-construct the shape inside the scope, but this would guarentee that, when hitting the exception handler, a message will exist, one way or another.

这篇关于使用未构造的消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆