简体   繁体   English

通过Biztalk管道拆分消息并提升属性

[英]Split message and promote properties via Biztalk pipeline

I am polling a well formatted xml messages from SQL Server table using sqlserver stored procedure that returnes me xml like the following one 我正在使用sqlserver存储过程从SQL Server表中轮询格式良好的xml消息,该程序返回xml,如下所示

<PolledMessage xmlns="http://SomeNamespace.ru/">
  <Message>
    <MessageNode>
      <MasterDataMemberAddRequest xmlns="http://AnotherNamespace">
        ...
      </MasterDataMemberAddRequest>
    </MessageNode>
  </Message>
  <Message>
    <MessageNode>
      <MasterDataMemberAddRequest xmlns="http://AnotherNamespace">
        ...
      </MasterDataMemberAddRequest>
    </MessageNode>
  </Message>
</PolledMessage>

Where the MessageNode is a node, containing the message that i want to extract. MessageNode是一个节点,包含我想要提取的消息。 I have done that using Envelope schema with XmlReceive pipeline, and it worked well. 我已经使用带有XmlReceive管道的Envelope架构完成了这项工作,并且运行良好。 But after that i need to write some custom values to the message context of each of that extracted messages. 但之后我需要为每个提取的消息的消息上下文写一些自定义值。 i've wrote a custom pipeline, that takes property name, namespace and value and writes it to the message context, but i can't figure out how to put together that disassembling and promoting properties of disassembled messages. 我写了一个自定义管道,它接受属性名称,命名空间和值并将其写入消息上下文,但我无法弄清楚如何将反汇编和促进反汇编消息的属性放在一起。

Thanks for any advice! 谢谢你的建议!

Arsen, 阿尔森,

The XMLReceive pipeline debatches your envelope using the XML dissembler component, and will promote individual message properties providing they are correctly marked as context properties (and assuming they are in the message!) XMLReceive管道使用XML dissembler组件对您的信封进行破坏, 并将提升单个消息属性 ,前提是它们被正确标记为上下文属性 (并假设它们在消息中!)

If you need to push custom non-message properties into each message, you could create a custom pipeline and place your pipeline component that acts on each disassembled message in the resolve party stage . 如果需要将自定义非消息属性推送到每条消息中,则可以创建自定义管道并将管道组件放置在解析方阶段中的每个反汇编消息

在此输入图像描述

Here's a link to a custom context property promotion component. 这是自定义上下文属性提升组件的链接 You'll see in the example that it is placed in the validate stage - I believe validate or resolve party are both ok. 您将在示例中看到它被置于验证阶段 - 我相信验证或解析方都可以。 Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM