2010-08-02 4 views
0

Microsoft BizTalk 2009에서 우리는 내장 TestableReceivePipeline 클래스를 사용하여 ReceivePipeline (플랫 파일 디스어셈블러가 있음)을 테스트하려고합니다. 하나의 단일 스키마를 사용하면 제대로 작동하지만 가져온 스키마가있는 스키마 (Schema1)를 사용하려고하면 오류 (System.Xml.Schema.XmlSchemaException : 'ABC'요소가 선언되지 않음)가 발생합니다. (스키마 2) 내부. 왜이 오류가 발생합니까? 테스트 파이프 라인에 대한가져온 스키마가있는 스키마를 가질 때 BizTalk TestableReceivePipeline을 사용하는 방법

코드 :

 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> 

답변

0

AFAIK 현재 BizTalk 2009에서는 지원되지 않습니다.

관련 문제