BizTalk 平面文件失败消息路由

发布于 2024-08-31 07:36:29 字数 256 浏览 4 评论 0原文

我在网络上发现了一些断线,人们声称能够在编排中使用 XLANGMessage 类型的接收形状来接收无法组装到特定 xsd 中的平面文件模式文件。

我尝试将接收形状中的消息类型设置为 Microsoft.XLANGS.BaseTypes.XLANGMessage,但此基本类型不可序列化。这会导致构建错误。

是否有一种对象类型可以捕获格式良好的 xml 消息的 XmlDocuments 以及格式错误的 xml 和未组装的平面文件?

I have found some broken threads across the web where people claim to be able to use receive shapes in an orchestration with XLANGMessage types to receive flat file schema files that could not be assembled into a specific xsd.

I've attempted to set the messagetype in the receive shape as Microsoft.XLANGS.BaseTypes.XLANGMessage, but this basetype is not serializable. This then causes a build error.

Is there an object type that can capture both XmlDocuments of well formed xml messages as well as malformed xml and non-assembled flat files?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倒带 2024-09-07 07:36:29

以粗体回答您的直接问题 - 是的,您想要的类型是 System.Xml.XmlDocument 。

您需要做的是创建一条新消息,并在选择其类型时,从 .NET 类部分选择上述类型。

当分配给接收形状时,该消息可以接收任何有效负载,例如,我经常使用它通过 BizTalk 传递 .pdf 文件等格式,而无需解析它们。但请注意,尽管有这个名称,但您这里所拥有的并不是 Xml,如果您尝试如此对待,将会导致各种问题。


为了进一步探究你的问题 - 你是否试图进行某种错误处理编排?

如果您在错误处理代码中,则可以有一个接收形状,该接收形状接收 XmlDocument 类型的消息,其过滤器表达式设置为 ErrorReport.ErrorType == "FailedMessage" ,该表达式绑定到直接连接到消息框的绑定端口。

我经常发现有两个接收形状很方便,一个用于在我们有任何可能的有效负载时捕获路由故障,另一个用于订阅您定义的强类型错误包装信封,并从其他编排的 CatchException 中传递出去形状。

这意味着您可以构建一个集中的地方来处理所有异常。


如果您还没有看过,有一个很好的 Charles Young 的帖子可能描述了与您想要做的事情类似的事情。

In answer to your direct question in bold - yes, the type you are after is System.Xml.XmlDocument.

What you need to do is create a new message and when selecting its type, select the above type from the .NET Classes section.

This message when assigned to a receive shape can then receive any payload, for example, I've often used this to pass formats such as .pdf files through BizTalk where I had no need to parse them. Do be aware, however, that despite the name, what you have here is not Xml and will cause you all sorts of issues if you try and treat is as such.


To dig a little further into your question - are you trying to make some sort of error handling orchestration?

If you are then in your error handling code you can just have a recieve shape that receives a message of type XmlDocument with its filter expression set to ErrorReport.ErrorType == "FailedMessage" that is bound to a direct bound port attached to the Message Box.

I've often found it handy to have two receive shapes, one to catch routing failures, when we have any possible payload, and another to subscribe to a strongly types fault wrapper envelope that you define and pass out of your other orchestrations from their CatchException shapes.

This means that you can then build one centralised place to handle all exceptions.


If you haven't seen it, there is a nice post by Charles Young that may describe something similar to what you are trying to do.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文