将XmlDocument转换为强类型消息 [英] Converting XmlDocument to strongly typed message
问题描述
我有一个接受XmlDocument类型消息的业务流程。我之所以将其配置为使用此类型是因为我希望相同的业务流程处理多种类型的消息,并且它们符合我在
BizTalk项目中定义的架构。但是当我无法在传入的Xml文档上应用地图时,因为Mapping Editor只接受强类型的消息。
I have an orchestration that accepts messages of type XmlDocument. The reason why I have configured it to use this type is because I want the same orchestration to process multiple type of messages and they conform to the schema that I have defined in the BizTalk project. However when I cannot apply the map on the incoming Xml Documents because the Mapping Editor only accepts strongly typed messages.
有没有人知道如何从XmlDocuments转换为Typed附加到特定模式的消息,以便我可以在BizTalk映射器中使用它们。
Does anyone have an idea as to how can I do the conversion from XmlDocuments to Typed messages adhering to a particular schema, so that I can use them inside the BizTalk mapper.
在此先感谢
推荐答案
假设您对应于XmlDocument的消息变量是AnyMsg,并且与强类型消息对应的消息变量是StrongMsg。接收形状后,使用构造消息形状,其中构造StrongMsg。在
构造消息形状内部使用消息赋值形状并在其中包含以下语句:StrongMsg = AnyMsg; StrongMsg(*)= AnyMsg(*);
Lets say your message variable corresponding to XmlDocument is AnyMsg and the message variable corresponding to your strongly typed message is StrongMsg. After your receive shape, use a construct message shape wherein you construct StrongMsg. Inside the construct message shape use a message assignment shape and have the following statements therein: StrongMsg = AnyMsg; StrongMsg(*) = AnyMsg(*);
这篇关于将XmlDocument转换为强类型消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!