【发布时间】:2017-05-10 08:51:14
【问题描述】:
我正在使用 BizTalk 2013 R2。我有一个需要反汇编的输入文件:
<Root xmlns="http://Test.XmlDasmAsm.BIZ.Schemas.schEnveloppe">
<DOC xmlns="http://Test.XmlDasmAsm.BIZ.Schemas.schDocument">
<Id>1</Id>
<Description>Description 001</Description>
</DOC>
<DOC xmlns="http://Test.XmlDasmAsm.BIZ.Schemas.schDocument">
<Id>2</Id>
<Description>Description 002</Description>
</DOC>
<DOC xmlns="http://Test.XmlDasmAsm.BIZ.Schemas.schDocument">
<Id>3</Id>
<Description>Description 003</Description>
</DOC>
</Root>
这是我的信封架构:
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://Test.XmlDasmAsm.BIZ.Schemas.schEnveloppe" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:ns0="http://Test.XmlDasmAsm.BIZ.Schemas.schDocument" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://Test.XmlDasmAsm.BIZ.Schemas.schEnveloppe" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import schemaLocation=".\schDocument.xsd" namespace="http://Test.XmlDasmAsm.BIZ.Schemas.schDocument" />
<xs:annotation>
<xs:appinfo>
<b:schemaInfo is_envelope="yes" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
<b:references>
<b:reference targetNamespace="http://Test.XmlDasmAsm.BIZ.Schemas.schDocument" />
</b:references>
</xs:appinfo>
</xs:annotation>
<xs:element name="Root">
<xs:annotation>
<xs:appinfo>
<b:recordInfo body_xpath="/*[local-name()='Root' and namespace-uri()='http://Test.XmlDasmAsm.BIZ.Schemas.schEnveloppe']" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="ns0:DOC" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
这是我的文档架构:
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://Test.XmlDasmAsm.BIZ.Schemas.schDocument" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" elementFormDefault="qualified" targetNamespace="http://Test.XmlDasmAsm.BIZ.Schemas.schDocument" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="DOC">
<xs:complexType>
<xs:sequence>
<xs:element name="Id" type="xs:int" />
<xs:element name="Description" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
XmlDasm 的反汇编阶段运行良好,我的信封模式文件使用 xml 输入文件实例进行验证。我的问题是使用相同的模式文件重新组装反汇编文件(具有 1 个或多个实例)。所以这是我的反汇编文件:
<DOC xmlns="http://Test.XmlDasmAsm.BIZ.Schemas.schDocument">
<Id>1</Id>
<Description>Description 001</Description>
</DOC>
命令如下:
"c:\Program Files (x86)\Microsoft BizTalk Server 2013 R2\SDK\Utilities\PipelineTools\XmlAsm.exe" ..\Xml\DOC1.xml -es ..\Schemas\schEnveloppe.xsd -ds ..\Schemas\schDocument.xsd -c
还有错误信息:
Error
Source: XML assembler
Message: The 'http://Test.XmlDasmAsm.BIZ.Schemas.schDocument:DOC' element is not declared.
HRESULT: 80131941
我认为我的问题出在我的架构中,但所有示例文件都使用所有架构进行验证。
不幸的是,关于 xmlasm 的文档很差。有什么想法吗?
【问题讨论】:
-
那么,它在 BizTalk Server 中运行时有效吗?没有人真正使用管道测试工具。
-
不,它在 BizTalk Server 中不起作用。我通过调用
Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteSendPipeline和Microsoft.XLANGs.Pipeline.SendPipelineInputMessages在相关的编排中使用它。在这里我想隔离我的问题。
标签: xml xsd biztalk xsd-validation biztalk-2013