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 ...
随机推荐
- 学习UI设计书籍推荐
在学习UI设计的过程当中,特别想学或者零基础的人来说,需要学习到很多知识,比如软件 PS AI ,理论 色彩 排版 规范 UE 等,这些都是一名UI设计师需要学习的知识,而学习到这些知识,可以通过视频 ...
- AX_Currency
Currency::curAmount(9.23,"HKD"); Currency::curAmount2CurAmount(9.23,"RMB"," ...
- solr7.7.0搜索引擎使用(一)(下载安装)
一.下载安装 可以直接在官网下载地址:https://lucene.apache.org/solr/ 解压之后,目录结构如下图,bin里边提供部署的文件,contrib提供额外的jar包,docs提供 ...
- Python 多进程编程之multiprocessing--Process
Python 多进程编程之multiprocessing 1,Process 跨平台的进程创建模块(multiprocessing), 支持跨平台:windowx/linux 创建和启动 创 ...
- JavaScript 高阶函数
高阶函数的英文叫Higher-order function ,什么是高阶函数呢>? JavaScript的函数其实都指向某个变量.既然变量可以指向函数,函数的参数能接收变量,那么一个函数就可以接 ...
- Linux下gcc编译控制动态库导出函数小结
根据说明文档“How To Write Shared Libraries"介绍, 有四种方法: 1. 在方法声明定义时,加修饰:__attribute__((visibility(" ...
- 浅谈数通畅联ECP与EAC的区别
最近收到很多客户的提问,AEAI ECP企业云联平台是什么产品?为什么AEAI ECP中包括集成套件?EAC也是数通畅联的产品吗?同样涉及集成两者有什么区别呢?诸如此类的问题还有很多. 其实AEAI ...
- kaldi脚本注释二
steps/decode.sh #!/bin/bash # Copyright 2012 Johns Hopkins University (Author: Daniel Povey) # Apach ...
- 【spring源码分析】IOC容器初始化——查漏补缺(一)
前言:在[spring源码分析]IOC容器初始化(十一)中提到了初始化bean的三个步骤: 激活Aware方法. 后置处理器应用(before/after). 激活自定义的init方法. 这里我们就来 ...
- 从文本中读取字符——feof函数问题
feof()函数 函数原型:int feof(FILE *fp): 函数功能:检测流上的文件结束符,如果文件结束,则返回非0值,否则返回0,文件结束符只能被clearerr()函数清除 (函数feof ...