在接收管道中动态添加消息部分

发布于 2024-09-05 08:46:16 字数 304 浏览 2 评论 0原文

我尝试创建一个自定义管道组件,它接受消息并动态附加其他部分(在反汇编阶段)。我还没有设置发送端口,以便我可以看到 BizTalk 正在尝试处理的内容。我只能看到身体部分,其他部分看不到。这是我使用的代码:

var part = pc.GetMessageFactory().CreateMessagePart();
part.Data = new MemoryStream(new byte[] {1, 2, 3, 4, 5});
inmsg.AddPart("another_part", part, false);

谢谢。

I tried to create a custom pipeline component that takes a message and attaches additional another part dynamically (during Disassemble stage). I haven't set up a send port, so that I can see what BizTalk is trying to process. I can see only the body part, the additional part doesn't show up. This is the code I used:

var part = pc.GetMessageFactory().CreateMessagePart();
part.Data = new MemoryStream(new byte[] {1, 2, 3, 4, 5});
inmsg.AddPart("another_part", part, false);

Thank you.

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

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

发布评论

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

评论(1

好多鱼好多余 2024-09-12 08:46:16

大多数适配器不会查看消息正文部分之外的任何内容。与 Web 服务相关的适配器以及 SMTP 适配器是例外,它们可以包含额外的部分作为电子邮件的附件。

这实际上是有道理的;例如,文件适配器将如何处理多个部分?将每个文件保存为单独的文件?

您看到 MIME 编码器产生差异的原因是因为它通过将每个部分编码到生成的 MIME 消息中来显式处理多部分消息。

Most adapters don't look at anything beyond the body part of the message. Exceptions are the web-service related adapters as well as the SMTP one, which can include the extra parts as attachments to the email.

This actually makes sense; for example, what would the file adapter do with multiple parts? Save each one as a separate file?

The reason you see the MIME encoder making a difference is because it explicitly handles multi-part messages by encoding each part into the resulting MIME message.

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