4

フラットファイルスキーマ(以下の説明)があり、カスタムパイプラインを介してフラットファイル(以下の説明)を取得しています。フラットファイルは、次のエラーで逆アセンブルフェーズに失敗します:検索中にストリームの予期しない終了:'\ r\n'現在解析される定義はルートです。エラーが発生したストリームオフセットは202です。エラーが発生した行番号は5です。エラーが発生した列は0です。HRESULT:80131940

さまざまなオプション(子の順序、子の区切り文字など)を試しましたが、すべて同じエラーで失敗します。フッターとレコードが同じ文字で始まるため、タグ識別子を使用できません。

オーケストレーションで完全なメッセージを取得する必要があります。ヘッダー、フッタートレーラーを使用できないためです(トレーラーは常にドロップされます)。

スキーマ:

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://BizTalk_Server_Project1.FlatFileSchema1" targetNamespace="http://BizTalk_Server_Project1.FlatFileSchema1" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:annotation>
    <xs:appinfo>
      <schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
      <b:schemaInfo standard="Flat File" codepage="65001" default_pad_char=" " pad_char_type="char" count_positions_by_byte="false" parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false" generate_empty_nodes="true" allow_early_termination="false" early_terminate_optional_fields="false" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" root_reference="Root" />
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="Root">
    <xs:annotation>
      <xs:appinfo>
        <b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="infix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
      </xs:appinfo>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:annotation>
          <xs:appinfo>
            <b:groupInfo sequence_number="0" />
          </xs:appinfo>
        </xs:annotation>
        <xs:element minOccurs="1" maxOccurs="1" name="Header">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo structure="positional" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
            </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:annotation>
                <xs:appinfo>
                  <b:groupInfo sequence_number="0" />
                </xs:appinfo>
              </xs:annotation>
              <xs:element name="Header_Child1" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" pos_offset="0" pos_length="15" sequence_number="1" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="Header_Child2" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" pos_offset="0" pos_length="15" sequence_number="2" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="Header_Child3" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" pos_offset="0" pos_length="15" sequence_number="3" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Record">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo structure="positional" sequence_number="2" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
            </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:annotation>
                <xs:appinfo>
                  <b:groupInfo sequence_number="0" />
                </xs:appinfo>
              </xs:annotation>
              <xs:element name="Record_Child1" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" pos_offset="0" pos_length="18" sequence_number="1" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="Record_Child2" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" pos_offset="0" pos_length="18" sequence_number="2" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="Record_Child3" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" pos_offset="0" pos_length="16" sequence_number="3" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="1" maxOccurs="1" name="Footer">
          <xs:annotation>
            <xs:appinfo>
              <b:recordInfo structure="positional" sequence_number="3" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
            </xs:appinfo>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:annotation>
                <xs:appinfo>
                  <b:groupInfo sequence_number="0" />
                </xs:appinfo>
              </xs:annotation>
              <xs:element name="Footer_Child1" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" pos_offset="0" pos_length="15" sequence_number="1" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="Footer_Child2" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" pos_offset="0" pos_length="15" sequence_number="2" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
              <xs:element name="Footer_Child3" type="xs:string">
                <xs:annotation>
                  <xs:appinfo>
                    <b:fieldInfo justification="left" pos_offset="0" pos_length="15" sequence_number="3" />
                  </xs:appinfo>
                </xs:annotation>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

フラットファイルサンプル:

Header Field1  Header Field2  Header Field3  
Record 1 Field 1  Record 1 Field 2  Record 1 Field 3
Record 2 Field 1  Record 2 Field 2  Record 2 Field 3
Footer Field1  Footer Field2  Footer Field3 

ありがとう、アサフ

4

2 に答える 2

7

ヤコフ、

私はここで何かが欠けているかもしれませんが、あなたがやろうとしていることをあなたができるとは思いません–

ヘッダーレコードがあり、そのうちの1つがあるため、BizTalkはそれを処理できます。最初のレコードがヘッダーレコードであると想定し、スキーマに従って正しく解析できます。

次に、「Record」の無制限のレコードセットがあり、BizTalkはそれらも適切に処理します。他のすべてのレコードを「Record」として解析しようとし、Child Orderプロパティに応じて、各レコードの後に​​区切り文字が必要になります。ファイルの終わりかどうか。

次に、フッターレコードがありますが、タグIDがないため、BizTalkは、レコードをフッターレコードとして解析するタイミングがわかりません。-'ファイルの最後の行'という概念はありません。

そのため、ヘッダーレコードの後のすべてのレコードを「レコード」として解析し、欠落しているように見えるフッターレコードを探します。

これを解決する方法は、レコードタイプ、この例では少なくともフッターにタグを提供することです。

フッターレコードに「Footer」タグを追加し、ファイルを正しく解析しました(ここでも、Child Orderプロパティの値に応じて、最後にキャリッジリターンが必要です)。

これが理にかなっているといいのですが

ヨッシ

于 2011-03-17T08:10:53.753 に答える
1

解析するファイルの最後にcarraigereturnを追加すると。ファイルの最後にキャリッジリターンがない場合は、Footer要素のChildOrderプロパティをプレフィックスに変更できます。

于 2011-03-16T14:03:26.553 に答える