开发者

Adding Message Part dynamically in Receive Pipeline

开发者 https://www.devze.com 2023-01-02 21:29 出处:网络
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 Bi

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消