使用Xml Disassemble

 

你将学会

1. 创建Schema

2. 创建PipeLine

3. 使用Xml disassemble

4. 测试Pipeline

5.

用例介绍

将输入Xml文件分解成文档Xml

输入

<Customers>

<Customer>

<CustomerID>1</CustomerID>

<Name>xuzhong</Name>

</Customer>

<Customer>

<CustomerID>2</CustomerID>

<Name>yangerkf</Name>

</Customer>

<Customer>

<CustomerID>3</CustomerID>

<Name>xxx</Name>

</Customer>

</Customers>

输出

每一个子节点

File1

<Customer>

<CustomerID>1</CustomerID>

<Name>xuzhong</Name>

</Customer>

File2

<Customer>

<CustomerID>2</CustomerID>

<Name>yangerkf</Name>

</Customer>

File3

<Customer>

<CustomerID>3</CustomerID>

<Name>xxx</Name>

</Customer>

Step by step

1. 创建解决方案clip_image002.jpg

2. 创建项目clip_image004.jpg

3. 创建Envelope Schemaclip_image006.jpg将Target Namespace设置成空 ,因为输入的Xml没有定义Namespace
(2)设置Envelope(信封)属性为Yes(是)
clip_image008.jpg定义Node
(4)修改Customers的Document XPath属性,如图配置
clip_image010.jpg修改Customer的Data structure Type属性为xs:anyType

4. 创建Document Schema clip_image012.jpg
(1)修改Target Namespace为空,因Document中无Namespace
(2)添加如图的Node

5. 测试Schema是否符合Pipeline要求
(1)生成Envelope测试实例,创建文件Test.xml,内容为用例内容,保存到项目目录中
clip_image014.jpg
(2)运行xmldasm.exe测试Schema定义是否有效clip_image016.jpg如果看到了这样的结果,那么就表明定义的Schema是正确的,如果有其它错误信息,基本上者是schema定义的有问题

6. 创建Pipeline
(1)创建CustomerPipeline.btp
(2)添加Xml disassemble
(3)配置Document Schema 为SchemaDocument.xsd
(3)配置Evnelope Schema 为SchemaEnvelope.xsd
clip_image018.jpg

7. 创建Orchestration
(1)创建一个Orchestration
(2)创建一个接收端口,接收数据类型为SchemaDocument,使用后期绑定端口
(3)部署
(4)配置接收端口,配置接收Pipeline为CustomerPipeline。
(5)这样,接收的Schema为SchemaEnvelope,但输入的到Orchestration中的Schema为SchemaDocument
时间原因,不进行演示了

转载于:https://www.cnblogs.com/anbl/archive/2007/04/13/712445.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值