2012-06-20 4 views
1

BizTalk에서 처리하기 위해 많은 양의 XML을 전달하고 있습니다. 내가 BizTalks 생성 항목 마법사 있지만 통해 스키마를 생성하는 시도BizTalk에서이 XML을 처리하는 방법

<FieldItem> 
     <Name>EducationAndQualifications</Name> 
     <Value xsi:type="RepeatingFieldArray"> 
      <Fields> 
       <RepeatingField> 
        <Items> 
         <FieldItem> 
          <Name>Qualification</Name> 
          <Value xsi:type="xsd:string">umbraco</Value> 
         </FieldItem> 
         <FieldItem> 
          <Name>Establishment</Name> 
          <Value xsi:type="xsd:string">IBM</Value> 
         </FieldItem> 
         <FieldItem> 
          <Name>DateAchieved</Name> 
          <Value xsi:type="xsd:string">June 2011</Value> 
         </FieldItem> 
        </Items> 
       </RepeatingField> 
      </Fields> 
     </Value> 
    </FieldItem> 

: 때때로 이름 값 쌍 이런 식으로 뭔가를 찾고, 더 복잡하게, 그러나

<FieldItem> 
    <Name>EmploymentStatus</Name> 
    <Value xsi:type="xsd:string">1</Value> 
</FieldItem> 

: XML은 주로 형태 그것은 변화하는 유형들과 거기에있을 수도 있고 없을 수도있는 추가적인 반복 필드들에 대처할 수 없다.

그래서 나는 이것에 대한 최선의 방법에 대한 조언/지침을 찾고 있습니다. BizTalk가이를 처리하고자하는 스키마를 만들 수 있습니까? 또는 현재 내가 선호하는 솔루션을 별도의 메시지로 분할하는 사용자 지정 파이프 라인 구성 요소를 만들어야합니까?

감사합니다.

UPDATE

나는 다음과 같은 스키마를 작성하는 경우 :

<?xml version="1.0" encoding="utf-16" ?> 
<xsd:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
<xsd:element name="FormData"> 
    <xsd:complexType> 
     <xsd:sequence> 
      <xsd:element name="FormName" type="xsd:string" /> 
      <xsd:element name="FormInstanceId" type="xsd:string" /> 
      <xsd:element name="Status" type="xsd:string" /> 
      <xsd:element name="Data"> 
       <xsd:complexType> 
        <xsd:sequence> 
         <xsd:element maxOccurs="unbounded" name="FieldItem"> 
          <xsd:complexType> 
           <xsd:sequence> 
            <xsd:element name="Name" type="xsd:string" /> 
            <xsd:element minOccurs="0" maxOccurs="unbounded" name="Value" nillable="true" type="xsd:anyType" /> 
           </xsd:sequence> 
          </xsd:complexType> 
         </xsd:element> 
        </xsd:sequence> 
       </xsd:complexType> 
      </xsd:element> 
     </xsd:sequence> 
    </xsd:complexType> 

나는 다음과 같은 오류 얻을 :

이 잘못된 XSI입니다 형식 'RepeatingFieldArray'

그래서 저는 여전히 기울고 있습니다. 보너스는이 모든 것을 정렬하기위한 코드를 작성하는 것입니다 ....

답변

1

나는 반복적 인 데이터를 반복적 인 데이터를 추출하여 일반적인 반복 키/값 쌍과 일치하는 일반 스키마로 추출하기로 결정했습니다. 각 메시지를 섹션별로 식별 할 수 있도록 추가 필드를 추가했습니다. 아래 참조 :

<?xml version="1.0" encoding="utf-16" ?> 
    <xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="https://BizTalk.Interfaces.INT034.Schemas.PropertySchema" attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> 
    <xs:annotation> 
    <xs:appinfo> 
    <b:imports xmlns:b="http://schemas.microsoft.com/BizTalk/2003"> 
     <b:namespace prefix="ns0" uri="https://BizTalk.Interfaces.INT034.Schemas.PropertySchema" location=".\PropertySchema.xsd" /> 
     </b:imports> 
     </xs:appinfo> 
     </xs:annotation> 
    <xs:element name="Root"> 
    <xs:annotation> 
    <xs:appinfo> 
    <b:properties> 
     <b:property name="ns0:Interface" xpath="/*[local-name()='Root' and namespace-uri()='']/*[local-name()='Interface' and namespace-uri()='']" /> 
     </b:properties> 
     </xs:appinfo> 
     </xs:annotation> 
    <xs:complexType> 
    <xs:sequence> 
     <xs:element name="Interface" type="xs:string" /> 
     <xs:element name="Type" type="xs:string" /> 
     <xs:element name="FormName" type="xs:string" /> 
     <xs:element name="FormInstanceId" type="xs:string" /> 
     <xs:element name="Status" type="xs:string" /> 
    <xs:element name="Data"> 
    <xs:complexType> 
    <xs:sequence> 
    <xs:element maxOccurs="unbounded" name="FieldItem"> 
    <xs:complexType> 
    <xs:sequence> 
     <xs:element name="Name" type="xs:string" /> 
     <xs:element name="Value" type="xs:string" /> 
     </xs:sequence> 
     </xs:complexType> 
     </xs:element> 
     </xs:sequence> 
     </xs:complexType> 
     </xs:element> 
     </xs:sequence> 
     </xs:complexType> 
     </xs:element> 
     </xs:schema> 
관련 문제