Biztalk Server zip unzip pipeline component Development
2007-03-13 11:38
330 查看
Biztalk Server zip unzip pipeline component Development
最近有个B2B的项目涉及和其他合作伙伴(partner)作数据传输,我们这边使用的开发平台(platform)是Biztalk Server 2006,数据传输管道(channel)采用window server 2003的MSMQ,但是由于MSMQ本身存在单个消息有4M限制的问题,虽软Biztalk Server 2006自带的MSMQ Adapter已经对大消息(Large Data)的支持,提供了[Support segmentation] if true , message larger than 4095KB(approximately 4MB) will be segmented,说明当发送单个报文实例(Instance)超过4MB的时候可以在发送至MSMQ对列的时候进行分割成几个小的消息发送,这些被分割的消息之间通过Message. CorrelationId进行关联具体的做法可以参考《MSMQ消息大于4MB限制的解决办法》采用对消息进行分割的做法会对接收消息需要作特定的判断,相对于对报文压缩来得比较简单;
下面介绍一下如何通过对Biztalk Pipeline的二次开发实现对报文进行压缩/解压得实现;
功能描述:
1/将Biztalk 流程(Orchestration)出来的消息在发送端口通过加载pipeline组件实现将消息以zip的方式进行压缩(zip可以对Xml,txt文档的压缩比达到10:1)
2/将接收的zip文件(支持包含多个文件批处理(batch))进行压缩后进入Biztalk流程(Orchestration)处理;
具体实现:
要实现对Biztalk Pipeline的开发对如下接口[Microsoft.BizTalk.Component.Interop.IComponent,IBaseComponent, IPersistPropertyBag, IComponentUI]做实现,好在现在网上提供pipeline component wizrad:http://www.gotdotnet.com/Workspaces/Workspace.aspx?id=1d4f7d6b-7d27-4f05-a8ee-48cfcd5abf4a 可以下载到pipeline开发向导
实现对文件进行压缩/解压需要的[ICSharpCode.SharpZipLib.dll]目前版本0.85相当稳定;下载地址:http://www.icsharpcode.net/OpenSource/SharpZipLib/ 具体方法请查看版本
通过安装pipeline component wizrad之后就可以在vs.net中创建你的pipeline component组件了。CategoryTypes表示该组件可以加载到pipline的什么位置CategoryTypes.CATID_Any表示任何位置都可以放;
[ComponentCategory(CategoryTypes.CATID_PipelineComponent)]
[System.Runtime.InteropServices.Guid("62656b9b-7d69-407d-b71f-d3c0415c82af")]
[ComponentCategory(CategoryTypes.CATID_DisassemblingParser)]
public class UnzipDisassemblerComponent : Microsoft.BizTalk.Component.Interop.IDisassemblerComponent, IBaseComponent, IPersistPropertyBag, IComponentUI
{
private System.Resources.ResourceManager resourceManager = new System.Resources.ResourceManager("Execution.BizTalk.Common.Pipelines.UnzipDisassemblerPipeline", Assembly.GetExecutingAssembly());
#region IBaseComponent members
下面是对Biztalk消息进行解压/压缩的代码实现。
1
11 public void Disassemble(Microsoft.BizTalk.Component.Interop.IPipelineContext pc, Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
12
13
149
150
151//压缩消息
152
153
173 public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(
174
175 Microsoft.BizTalk.Component.Interop.IPipelineContext pc,
176
177 Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
178
179
最近有个B2B的项目涉及和其他合作伙伴(partner)作数据传输,我们这边使用的开发平台(platform)是Biztalk Server 2006,数据传输管道(channel)采用window server 2003的MSMQ,但是由于MSMQ本身存在单个消息有4M限制的问题,虽软Biztalk Server 2006自带的MSMQ Adapter已经对大消息(Large Data)的支持,提供了[Support segmentation] if true , message larger than 4095KB(approximately 4MB) will be segmented,说明当发送单个报文实例(Instance)超过4MB的时候可以在发送至MSMQ对列的时候进行分割成几个小的消息发送,这些被分割的消息之间通过Message. CorrelationId进行关联具体的做法可以参考《MSMQ消息大于4MB限制的解决办法》采用对消息进行分割的做法会对接收消息需要作特定的判断,相对于对报文压缩来得比较简单;
下面介绍一下如何通过对Biztalk Pipeline的二次开发实现对报文进行压缩/解压得实现;
功能描述:
1/将Biztalk 流程(Orchestration)出来的消息在发送端口通过加载pipeline组件实现将消息以zip的方式进行压缩(zip可以对Xml,txt文档的压缩比达到10:1)
2/将接收的zip文件(支持包含多个文件批处理(batch))进行压缩后进入Biztalk流程(Orchestration)处理;
具体实现:
要实现对Biztalk Pipeline的开发对如下接口[Microsoft.BizTalk.Component.Interop.IComponent,IBaseComponent, IPersistPropertyBag, IComponentUI]做实现,好在现在网上提供pipeline component wizrad:http://www.gotdotnet.com/Workspaces/Workspace.aspx?id=1d4f7d6b-7d27-4f05-a8ee-48cfcd5abf4a 可以下载到pipeline开发向导
实现对文件进行压缩/解压需要的[ICSharpCode.SharpZipLib.dll]目前版本0.85相当稳定;下载地址:http://www.icsharpcode.net/OpenSource/SharpZipLib/ 具体方法请查看版本
通过安装pipeline component wizrad之后就可以在vs.net中创建你的pipeline component组件了。CategoryTypes表示该组件可以加载到pipline的什么位置CategoryTypes.CATID_Any表示任何位置都可以放;
[ComponentCategory(CategoryTypes.CATID_PipelineComponent)]
[System.Runtime.InteropServices.Guid("62656b9b-7d69-407d-b71f-d3c0415c82af")]
[ComponentCategory(CategoryTypes.CATID_DisassemblingParser)]
public class UnzipDisassemblerComponent : Microsoft.BizTalk.Component.Interop.IDisassemblerComponent, IBaseComponent, IPersistPropertyBag, IComponentUI
{
private System.Resources.ResourceManager resourceManager = new System.Resources.ResourceManager("Execution.BizTalk.Common.Pipelines.UnzipDisassemblerPipeline", Assembly.GetExecutingAssembly());
#region IBaseComponent members
下面是对Biztalk消息进行解压/压缩的代码实现。
1
11 public void Disassemble(Microsoft.BizTalk.Component.Interop.IPipelineContext pc, Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
12
13
149
150
151//压缩消息
152
153
173 public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(
174
175 Microsoft.BizTalk.Component.Interop.IPipelineContext pc,
176
177 Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
178
179
相关文章推荐
- Professional asp.net 2.0 server control and component development
- Professional ASP.NET 2.0 Server Control and Component Development
- Professional asp.net 2.0 Server Control and Component Development
- 电子书下载:Professional ASP.NET 2.0 Server Control and Component Development
- Zip & Unzip Component
- 读书笔记《Professional ASP.NET Server Control and Component Development》
- BIZTALK: Cannot perform encryption or decryption because the secret is not available from the master secret server
- LifecycleException: Failed to start component [StandardServer[8005]]
- Configuring JD Edwards Deployment Server and Development Client on Oracle VM VirtualBox
- BizTalk 2010: BizTalk Server Application Service (BTSNTSvc.exe) fails to start automatically after a system restart
- Darwin Streaming Server 6.0.3 - setup, customization, plugin or module development
- reactNative Could not connect to development server解决思路
- 使用IIS Express代替ASP.NET Development Server
- linux zip/unzip命令
- OLEDB adapter for Biztalk server 2006更新[源码]
- 一个 vs2008 无法连接到Asp.net Development Server的问题
- Rolling with developments in the Web component programming model
- 在Windows Server 2003 上安装和配置Microsoft BizTalk Server 2006
- BSOPCServer Development - 实现类工厂
- 【VS2008无法启动asp.net development server】的解决