BizTalk FF 反汇编程序 - 仅适用于非常小的文件



我有一个 BizTalk 2016/VS 2015 解决方案。 有一个简单的平面文件架构,它通过让重复记录元素将其"最大发生次数"属性设置为 0 来取消对每一行进行批处理。

架构的"配置"部分如下所示:

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF" 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="true" early_terminate_optional_fields="true" allow_message_breakup_of_infix_root="true" compile_parse_tables="false" root_reference="Employee" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Employee">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xA" child_order="postfix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
<b:properties>
<b:property distinguished="true" xpath="/*[local-name()='Employee' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']/*[local-name()='Data' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']/*[local-name()='NiNumber' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']" />
<b:property distinguished="true" xpath="/*[local-name()='Employee' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']/*[local-name()='Data' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']/*[local-name()='OrgLeaveDate' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']" />
<b:property distinguished="true" xpath="/*[local-name()='Employee' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']/*[local-name()='Data' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']/*[local-name()='PosLeaveDate' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']" />
<b:property distinguished="true" xpath="/*[local-name()='Employee' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']/*[local-name()='Data' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']/*[local-name()='PostStartDate' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']" />
</b:properties>
</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="1" name="Data">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0x9" child_order="infix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>

输入文件用 unix 样式的行尾以制表符分隔。

关于平面文件架构的唯一一点不寻常的事情是最后一个元素"PostStartDate"的 micOccurs 属性值为 0。这是因为这些文档有几个提供程序,其中一个提供程序不包含"PostStartDate"列。

我已经设置了一个包含 FF 分解器的接收位置。它将 DocumentSpecName 属性设置为架构的属性。所有其他属性均为默认值。

此接收的唯一订阅者是发送到本地文件夹的发送端口。

如果我删除一个包含 3 行的平面文件,那么一切正常。但是,如果我再扩展几行(在此示例中总共 7 行(,则 BizTalk 将在接收位置挂起,并显示错误:"消息引擎在处理一条或多封入站邮件期间遇到错误。在事件日志中,我看到错误:

There was a failure executing the receive pipeline: "LCC.Integration.Common.Pipelines.RcvArchiveFF, LCC.Integration.Common.Pipelines, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ff3873c2d0a7e656" Source: "Flat file disassembler" Receive Port: "SharePoint.Employees.Receive.SAPExtract" URI: "D:FileDropEmployeesIn*.txt" Reason: Unexpected data found while looking for:
't'
The current definition being parsed is Employee. The stream offset where the error occured is 1813. The line number where the error occured is 8. The column where the error occured is 0.

我注意到的另一件事是,如果我从文件的最后一行中删除尾随的 LF,那么它可以工作 - 无论行数如何。

我制作了一个截屏视频来演示问题:问题的截屏视频

我创建了一个示例解决方案来演示该问题。这在以下 github 存储库中可用:https://github.com/RobBowman/BizTalkFFProblem

有什么想法吗?

编辑:我刚刚在 BizTalk 2013R2 中尝试了您的 GitHub 示例,无需更改即可正常工作。

编辑2:>20行时中断。

Edit3:我现在意识到它并不真正受支持,设置是:"允许Infix根消息分解"......您的架构不是中缀,而是postfix。仅在infix时支持在反汇编上对平面文件进行反批处理。如果可能,您应该使架构支持infix,然后它将起作用。

最新更新