0

在 Microsoft BizTalk 2009 下,我们希望使用内置的 TestableReceivePipeline 类来测试 ReceivePipeline(它有一个平面文件反汇编程序)。如果我们使用一个单一的模式,它工作正常,但是当我们尝试使用具有导入模式( Schema2) 里面。为什么我会收到此错误?

测试管道的代码:

        StringCollection documents = new StringCollection();
        documents.Add(@"c:\Test.dat");

        StringCollection parts = new StringCollection();

        Dictionary<string, string> schemas = new Dictionary<string, string>();
        schemas.Add("MyCompany.Schema2", @"C:\Schema2.xsd");
        schemas.Add("MyCompany.Schema1", @"C:\Schema1.xsd");

        Microsoft.BizTalk.TestTools.Pipeline.TestableReceivePipeline pipeline = new MyReceivePipeline();
        pipeline.TestPipeline(documents, parts, schemas);

Schema1.xsd 来源:

<xs:import schemaLocation=".\Schema2.xsd" namespace="http://MyCompany.Schema2" />
<xs:element name="Schema1">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="Header">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="ClientRef" type="xs:string">
                            <xs:annotation>
                                <xs:appinfo>
                                    <b:fieldInfo justification="left" sequence_number="1" wrap_char_type="default" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
                                </xs:appinfo>
                            </xs:annotation>
                        </xs:element>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element ref="ns1:Data" />
            <xs:element name="Tail">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="RecordCount" type="xs:int">
                            <xs:annotation>
                                <xs:appinfo>
                                    <b:fieldInfo justification="left" sequence_number="3" wrap_char_type="default" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
                                </xs:appinfo>
                            </xs:annotation>
                        </xs:element>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
</xs:element>

Schema2.xsd 来源:

<xs:element name="Data">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="FirstName" type="xs:string" nillable="true">
                <xs:annotation>
                    <xs:appinfo>
                        <b:fieldInfo justification="left" wrap_char_type="default" sequence_number="2" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
                    </xs:appinfo>
                </xs:annotation>
            </xs:element>
            <xs:element name="Surname" type="xs:string" nillable="true">
                <xs:annotation>
                    <xs:appinfo>
                        <b:fieldInfo justification="left" sequence_number="3" wrap_char_type="default" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
                    </xs:appinfo>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
</xs:element>

4

1 回答 1

0

AFAIK 目前 BizTalk 2009 不支持此功能。

于 2010-08-23T22:35:23.247 回答