export-to-csvbiztalkbiztalk-2013r2

Unable to read the stream produced by the pipeline when generate CSV without header with send pipeline BizTalk


I have to generate a CSV file without the header line.

So I created the following xsd :

<?xml version="1.0" encoding="utf-16" ?>
<xs:schema xmlns="http://Person.Schemas.Person_Export" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://Person.Schemas.Person_Export" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:annotation>
        <xs:appinfo>
            <b:schemaInfo standard="Flat File" root_reference="Person_Export" 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"/>
            <schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions"/>
        </xs:appinfo>
    </xs:annotation>
    <xs:element name="Person_Export">
        <xs:annotation>
            <xs:appinfo>
                <b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="1" child_delimiter_type="hex" child_delimiter="0x0D 0x0A" child_order="postfix"/>
            </xs:appinfo>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:annotation>
                    <xs:appinfo>
                        <b:groupInfo sequence_number="0"/>
                    </xs:appinfo>
                </xs:annotation>
                <xs:element name="Person">
                    <xs:annotation>
                        <xs:appinfo>
                            <b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="1" child_delimiter_type="char" child_delimiter="," child_order="infix"/>
                        </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" name="over_start_date" type="xs:date">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo justification="left" datetime_format="dd-MM-yyyy" sequence_number="1"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="1" name="over_end_date" type="xs:date">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo sequence_number="2" justification="left" datetime_format="dd-MM-yyyy"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="1" name="emp_name" type="xs:string">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo sequence_number="3" justification="left"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="1" name="emp_lastname" type="xs:string">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo sequence_number="4" justification="left"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="1" name="emp_firstname" type="xs:string">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo sequence_number="5" justification="left"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="1" name="EMP_UDF_DATA1" type="xs:string">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo sequence_number="6" justification="left"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="1" name="EMP_UDF_DATA2" type="xs:string">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo sequence_number="7" justification="left"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="1" name="EMP_UDF_DATA3" type="xs:string">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo sequence_number="8" justification="left"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="1" name="emp_birth_date" type="xs:date">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo sequence_number="9" justification="left" datetime_format="dd-MM-yyyy"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="1" name="EMP_HIRE_DATE" type="xs:date">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo sequence_number="10" justification="left" datetime_format="dd-MM-yyyy"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="1" default="1" name="WBU_PASSWORD" type="xs:string">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo sequence_number="11" justification="left"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="1" name="WBU_EMAIL" type="xs:string">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo sequence_number="12" justification="left"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="1" name="WBU_NAME" type="xs:string">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo sequence_number="13" justification="left"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="1" default="NL OFFICERS" name="WBG_ID" type="xs:string">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo sequence_number="14" justification="left"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="1" default="Dutch" name="WBLL_ID" type="xs:string">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo sequence_number="15" justification="left"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="1" name="USER_STATUS" type="xs:string">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo sequence_number="16" justification="left"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="1" default="N" name="WBU_CAN_PROXY" type="xs:string">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo sequence_number="17" justification="left"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="1" default="999999" name="EMP_SIN" type="xs:string">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo sequence_number="18" justification="left"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                            <xs:element minOccurs="1" name="EMP_VAL20" type="xs:string">
                                <xs:annotation>
                                    <xs:appinfo>
                                        <b:fieldInfo sequence_number="19" justification="left"/>
                                    </xs:appinfo>
                                </xs:annotation>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

The file is generated correctly :

<ns0:Person_Export xmlns:ns0="http://Person.Schemas.Person_Export">
    <Person>
        <over_start_date>26-11-2022</over_start_date>
        <over_end_date/>
        <emp_name>000123</emp_name>
        <emp_lastname>test</emp_lastname>
        <emp_firstname>test</emp_firstname>
        <EMP_UDF_DATA1/>
        <EMP_UDF_DATA2>+312345678</EMP_UDF_DATA2>
        <EMP_UDF_DATA3>012345678</EMP_UDF_DATA3>
        <emp_birth_date>29-04-1976</emp_birth_date>
        <EMP_HIRE_DATE>03-02-2000</EMP_HIRE_DATE>
        <WBU_PASSWORD>1</WBU_PASSWORD>
        <WBU_EMAIL>test@hotmail.com</WBU_EMAIL>
        <WBU_NAME>000123</WBU_NAME>
        <WBG_ID>NL OFFICERS</WBG_ID>
        <WBLL_ID>Dutch</WBLL_ID>
        <USER_STATUS/>
        <WBU_CAN_PROXY>N</WBU_CAN_PROXY>
        <EMP_SIN>999999</EMP_SIN>
        <EMP_VAL20>M</EMP_VAL20>
    </Person>
</ns0:Person_Export>

But the pipeline return this error :

Unable to read the stream produced by the pipeline. Details: Value cannot be null. Parameter name: format

The fields over_end_date, EMP_UDF_DATA1 and USER_STATUS must be blank in the output so in the mapping I setted the Value property to empty.

I tested this solution but doesn't resolved my issue.


Solution

  • Ok I managed to find a solution by changing the date type to string type.

    The fact that some date in my output must be empty was the reason for this error.