在接收管道中动态添加消息部分
我尝试创建一个自定义管道组件,它接受消息并动态附加其他部分(在反汇编阶段)。我还没有设置发送端口,以便我可以看到 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
大多数适配器不会查看消息正文部分之外的任何内容。与 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.