缺失值的 Biztalk 架构
Biztalk Schema for missing values
我有一个 txt 文件的 biztalk 2013-r2 架构,有时最后一列没有值。
With value:
Name, address, city, state, zip, phone
Mike Myers, 30 West Street, NY, 10001, 2124444444
Without value:
Name, address, city, state, zip, phone
Mike Myers, 30 West Street, NY, 10001,
当列有值时,没有问题。
当最后一列没有值时,出现以下错误:
PublicKeyToken=92c4a30afea05f3e" Source: "Flat file disassembler" Receive Port: "rp_List" URI: "C:\BiztalkTestFiles\List\myfiles\*.txt" Reason: Unexpected data found while looking for:
'\r\n'
The current definition being parsed is Mydefinition. The stream offset where the error occured is 101. The line number where the error occured is 2. The column where the error occured is 6.
是否有针对此类问题的解决方法?
附加架构:
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://usgeSales.ldcSyncList.schemas.MySchema" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://usgeSales.ldcSyncList.schemas.MySchema" 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="MySchema" />
</xs:appinfo>
</xs:annotation>
<xs:element name="MySchema">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="postfix" 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>
<groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
</xs:appinfo>
</xs:annotation>
<xs:element maxOccurs="unbounded" name="MySchema_Detail">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="," 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>
<groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Name" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="Address" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="State" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" sequence_number="3" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="Zip" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" sequence_number="4" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element maxOccurs="0" name="Phone" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" sequence_number="5" />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
文件 1:with.txt
Mike Myers, 30 West Street, NY, 10001, 2124444444
文件 2:without.txt
Mike Myers, 30 West Street, NY, 10001,
通常您只需将最后一个元素的最小出现次数设置为 0
还要确保您的记录确实以 CR 和 LF 结尾(使用 NotePad++ 并显示所有符号)
它在第 2 行第 11 列抱怨的事实,您的问题实际上可能是其他问题。
我有一个 txt 文件的 biztalk 2013-r2 架构,有时最后一列没有值。
With value:
Name, address, city, state, zip, phone
Mike Myers, 30 West Street, NY, 10001, 2124444444
Without value:
Name, address, city, state, zip, phone
Mike Myers, 30 West Street, NY, 10001,
当列有值时,没有问题。
当最后一列没有值时,出现以下错误:
PublicKeyToken=92c4a30afea05f3e" Source: "Flat file disassembler" Receive Port: "rp_List" URI: "C:\BiztalkTestFiles\List\myfiles\*.txt" Reason: Unexpected data found while looking for:
'\r\n'
The current definition being parsed is Mydefinition. The stream offset where the error occured is 101. The line number where the error occured is 2. The column where the error occured is 6.
是否有针对此类问题的解决方法?
附加架构:
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://usgeSales.ldcSyncList.schemas.MySchema" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://usgeSales.ldcSyncList.schemas.MySchema" 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="MySchema" />
</xs:appinfo>
</xs:annotation>
<xs:element name="MySchema">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="postfix" 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>
<groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
</xs:appinfo>
</xs:annotation>
<xs:element maxOccurs="unbounded" name="MySchema_Detail">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="," 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>
<groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Name" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="Address" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="State" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" sequence_number="3" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="Zip" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" sequence_number="4" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element maxOccurs="0" name="Phone" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" sequence_number="5" />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
文件 1:with.txt
Mike Myers, 30 West Street, NY, 10001, 2124444444
文件 2:without.txt
Mike Myers, 30 West Street, NY, 10001,
通常您只需将最后一个元素的最小出现次数设置为 0
还要确保您的记录确实以 CR 和 LF 结尾(使用 NotePad++ 并显示所有符号)
它在第 2 行第 11 列抱怨的事实,您的问题实际上可能是其他问题。