Debatching(Splitting) XML Message in Orchestration using DefaultPipeline - BizTalk 2010
Debatching(Splitting) XML Message in Orchestration using DefaultPipeline - BizTalk 2010
I have used the Default XML Receive pipeline to achieve it, but it can also be done by creating a custom pipeline which uses XML disassembler (where you can set the Envelope and Document Schema).
Pipeline is not available in Orchestration like other shapes, thus to use it we need to add reference to following assemblies(which will allow us to use methods in those assemblies) :
- Microsoft.XLANGs.Pipeline.dll
- Microsoft.BizTalk.Pipeline.dll
You can browse to the location BizTalk Installation Directory to find above dll's.
Most of the part of this post is borrowed from my earlier post which talks about debatching xml at receive port:
http://tech-findings.blogspot.in/2013/07/debatchingsplitting-xml-message-biztalk.html
Scenario:
We receive many item information but its wrapped (Enveloped) , so to process each item we need to unwrap it (remove the envelope and split individual Item message).
Below is what we receive (Input) :
<ns0:Items xmlns:ns0="http://TestingSchemas.ItemEnvelope">
<ns1:Product xmlns:ns1="http://TestingSchemas.Item">
<ID>ID_0</ID>
<Name>Name_0</Name>
<Quantity>100</Quantity>
<UnitPrice>100</UnitPrice>
</ns1:Product>
<ns1:Product xmlns:ns1="http://TestingSchemas.Item">
<ID>ID_0</ID>
<Name>Name_1</Name>
<Quantity>200</Quantity>
<UnitPrice>100</UnitPrice>
</ns1:Product>
<ns1:Product xmlns:ns1="http://TestingSchemas.Item">
<ID>ID_2</ID>
<Name>Name_2</Name>
<Quantity>300</Quantity>
<UnitPrice>100</UnitPrice>
</ns1:Product>
<ns1:Product xmlns:ns1="http://TestingSchemas.Item">
<ID>ID_3</ID>
<Name>Name_2</Name>
<Quantity>300</Quantity>
<UnitPrice>100</UnitPrice>
</ns1:Product>
<ns1:Product xmlns:ns1="http://TestingSchemas.Item">
<ID>ID_4</ID>
<Name>Name_2</Name>
<Quantity>300</Quantity>
<UnitPrice>100</UnitPrice>
</ns1:Product>
<ns1:Product xmlns:ns1="http://TestingSchemas.Item">
<ID>ID_5</ID>
<Name>Name_2</Name>
<Quantity>300</Quantity>
<UnitPrice>100</UnitPrice>
</ns1:Product>
<ns1:Product xmlns:ns1="http://TestingSchemas.Item">
<ID>ID_6</ID>
<Name>Name_2</Name>
<Quantity>300</Quantity>
<UnitPrice>100</UnitPrice>
</ns1:Product>
<ns1:Product xmlns:ns1="http://TestingSchemas.Item">
<ID>ID_7</ID>
<Name>Name_2</Name>
<Quantity>300</Quantity>
<UnitPrice>100</UnitPrice>
</ns1:Product>
<ns1:Product xmlns:ns1="http://TestingSchemas.Item">
<ID>ID_8</ID>
<Name>Name_2</Name>
<Quantity>300</Quantity>
<UnitPrice>100</UnitPrice>
</ns1:Product>
<ns1:Product xmlns:ns1="http://TestingSchemas.Item">
<ID>ID_9</ID>
<Name>Name_2</Name>
<Quantity>300</Quantity>
<UnitPrice>100</UnitPrice>
</ns1:Product>
</ns0:Items>
But we want (Output) :

- Name the root node, I have named it Items.

- Click on "Schema" and go to Properties Window
- Set the property "Envelope" as Yes, as this schema will be used as envelope and this is the property which helps disassembler to recognize it.
- So far good, envelope schema is ready but what about the document which will be wrapped.

- In the Property window select "Imports" and click on the ellipsis
- You will get Imports wizard pop-ed out .
- Click on add and select the document schema which we created in step 1.(Here it is Item schema)

- Click on the "Items" and go to property window and select the property Body XPath and set it to /*[local-name()='Items' and namespace-uri()='http://TestingSchemas.ItemEnvelope']. Doing so allows an Items node to contain any number of Item Document.
- Cool... Now we are ready with the resources, next is to validate schema, build it, sign it and deploy.


- Receive shape is configured to receive untyped message i.e. of type System.Xml.XmlDocument (which will receive enveloped message -ItemEnvelope Type) .
- Then we have a "DebatchScope" which is of type "Atomic" and Orchestration is of type Long running. Why Atomic scope? Because we will be calling/executing Pipeline within it and the pipeline is of non- serializable type.
- Next we have Expression shape named as "Execute Pipeline". It is here where we make call to pipeline and execute it which results in splitted messages.
- It contains following line: GetPipelineOutput=Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteReceivePipeline(typeof(Microsoft.BizTalk.DefaultPipelines.XMLReceive),ItemsIn);
- GetPipelineOutput is a DebatchScope variable of type: Microsoft.XLANGS.Pipeline.ReceivePipelineOutputMessages
- So we are executing the method ExecuteReceivePipeline() method of XLANGPipelineManager class which belongs to Microsoft.XLANGs.Pipeline and its output assigned to GetPipelineOutput.

- Then we have a loop shape "UntilLastMessage" and its same as while loop, below is the condition(tillspillited messages are available) : GetPipelineOutput.MoveNext()
- Next is Construct shape with Message Assignment within it, which has following code:
- At last we have Send shape which accepts message of type ItemOut and sends it .
- Now what, build the project , sign it and deploy .

- Receive Pipeline is PassThruReceive as we don't want its message type to be detected until the message reaches to ExecutePipeline shape in Orchestration.

- Now after both the ports are ready, it's time to bind it to the logical ports of our orchestration:


Debatching(Splitting) XML Message in Orchestration using DefaultPipeline - BizTalk 2010的更多相关文章
- Unable to perform unmarshalling at line number 16 and column 63 in RESOURCE hibernate.cfg.xml. Message: cvc-elt.1: 找不到元素 'hibernate-configuration' 的声明。
七月 02, 2017 4:32:37 下午 org.hibernate.Version logVersionINFO: HHH000412: Hibernate Core {5.2.10.Final ...
- BizTalk开发小技巧
BizTalk开发小技巧 随笔分类 - Biztalk Biztalk 使用BizTalk实现RosettaNet B2B So Easy 摘要: 使用BizTalk实现RosettaNet B2B ...
- [Java Basics3] XML, Unit testing
What's the difference between DOM and SAX? DOM creates tree-like representation of the XML document ...
- PHP 开发 APP 接口 学习笔记与总结 - XML 方式封装通信接口
1.PHP 生成 XML 数据 ① 拼接字符串 ② 使用系统类(DomDocument,XMLWriter,SimpleXML) 例1 使用 PHP 系统类中的 DomDocument 类: < ...
- XMl的解析简单的方法
首先需要jia包 xstream-1.4.7.jar Vo类 package com.zld.day06_03zk3demo.bean; import java.io.Serializable; im ...
- xml解析(4)
本节要点: DOM解析方式 SAX解析方式 DOM4J对XML的解析 XML用于将数据组织起来,形成文档用于存储和传输: 更多时候我们需要的是将xml中的数据解析出来,甚至是在程序中动态生成xml. ...
- php生成xml数据
1.php生成xml数据一般有2种方式, 一个是组装字符串,另一个就是使用php内置的系统类 2.使用php内置类生成xml数据 3.拼装字符串生成xml数据 public function stat ...
- Play XML Entities
链接:https://pentesterlab.com/exercises/play_xxe/course Introduction This course details the exploitat ...
- Modifying namespace in XML document programmatically
Modifying namespace in XML document programmatically static XElement stripNS(XElement root) { return ...
随机推荐
- redis主从复制详述
一.主从复制详述 原理其实很简单,master启动会生成一个run id,首次同步时会发送给slave,slave同步命令会带上run id以及offset,显然,slave启动(初次,重启)内存中没 ...
- linux虚拟机配置上网(静态IP)和配置tomcat服务环境
常用命令:vi或者vim编辑 ,按i编辑模式,按ecs进入基本模式,按 :w 保存:按 :wq 退出并保存:mv移动::q退出 :ln -sv apache-tomcat-8.0.24 tomca ...
- SLICK基础
1.sbt添加依赖 "com.typesafe.slick" %% "slick" % "3.2.3", "org.slf4j&q ...
- 3.在自己的bag上运行Cartographer ROS
1.验证自己的bag cartographer ROS提供了一个工具cartographer_rosbag_validate来自动分析包中的数据.在尝试调试cartographer之前运行这个工具. ...
- 图解HTTP第二章
简单的 HTTP 协议 1>HTTP 协议用于客户端和服务器端之间的通信 HTTP 协议和 TCP/IP 协议族内的其他众多的协议相同,用于客户端和服务器之间的通信.请求访问文本或图像等资源的一 ...
- spring与junit整合测试
1.导包4+2+aop+test 2.配置注解 3.测试
- MFC禁用关闭按钮
有时候我们在写MFC程序时,需要在对话框中开启线程处理一些事情,如果在线程执行过程中点击关闭按钮,会导致程序崩溃. 这里介绍一种解决方法,禁用关闭按钮 解决方法 开启线程前禁用关闭按钮 CMenu* ...
- 可遇不可求的Question之skip-name-resolve模式篇
mysql启用skip-name-resolve模式时出现Warning的处理办法 在优化MYSQL配置时,加入 skip-name-resolve ,在重新启动MYSQL时检查启动日志,发现有警告信 ...
- SWPU-ACM集训队周赛之组队赛(3-11)G题题解
点这里去做题 水水水水水,不难发现如下表 t 1 2 3 4 v 1 3 5 7 s 1 4 9 16 明显s=t*t 题目中对10000取模即取后四位,即对1000取余 #include<st ...
- 2018年2月19日我的java学习
2019/2/18 星期一今天学习了Java 中的面向对象思想主要学习了类 构造器等在学习修饰属性的过程中,有4点必须牢记前提是理解类的各种关系 类中有5种关系 本身 同包类 同包继承子类 不同包继承 ...