locked
Debatching Flat File issue RRS feed

  • Question

  • I am very new to BizTalk. Just testing one simple flat file upload to MS SQL using WCF-SQL Adapter. After few hours struggle. I noticed an issue with debatching.

    1. Flat file contains the following records. 1 and 2 records contains CRLF and no for last record

    IPOD,APPLE-IPOD,2,300
    LAPTOP,DELL-LAPTOP,2,400
    LAPTOP2,DELL-LAPTOP,3,900

    2. Generated XSD using Flat file wizard. I validated and generated instance also. Here is the instance. Looks good

    <ns0:Products xmlns:ns0="http://Nov081.Products">
      <Product>
        <ShortDesc>ShortDesc_0</ShortDesc>
        <FullDesc>FullDesc_0</FullDesc>
        <UOM>UOM_0</UOM>
        <UnitPrice>10.4</UnitPrice>
      </Product>
    </ns0:Products>

    3. With simple Orchestration contains only Receive and send port assigning same message to both. Used pipe line in Receive port to debatch the message. Max Occurs in schema changes to 1.

    However, process outputting the message with all 3 records in one XML message. Also noticed that both parent node PRODUCTS is repeated in Child nodes too. It was supposed to be PRODUCT (With out 'S' at the end)


    - < Products xmlns =" http://Nov081.Products " >
    - < Products xmlns =" " >
      < ShortDesc > IPOD </ ShortDesc >
      < FullDesc > APPLE-IPOD </ FullDesc >
      < UOM > 2 </ UOM >
      < UnitPrice > 300 </ UnitPrice >
      </ Products >
    - < Products xmlns =" " >
      < ShortDesc > LAPTOP </ ShortDesc >
      < FullDesc > DELL-LAPTOP </ FullDesc >
      < UOM > 2 </ UOM >
      < UnitPrice > 400 </ UnitPrice >
      </ Products >
    - < Products xmlns =" " >
      < ShortDesc > LAPTOP2 </ ShortDesc >
      < FullDesc > DELL-LAPTOP </ FullDesc >
      < UOM > 3 </ UOM >
      < UnitPrice > 900 </ UnitPrice >
      </ Products >
      </ Products >




    4. Here is the schema generated from Flat file

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://Nov081.Products" targetNamespace="http://Nov081.Products" 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="0" 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="Products" />
        </xs:appinfo>
      </xs:annotation>
      <xs:element name="Products">
        <xs:annotation>
          <xs:appinfo>
            <b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0x0D 0x0A" 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="1" name="Product">
              <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="ShortDesc" type="xs:string">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:fieldInfo justification="left" sequence_number="1" />
                      </xs:appinfo>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="FullDesc" type="xs:string">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:fieldInfo justification="left" sequence_number="2" />
                      </xs:appinfo>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="UOM" type="xs:string">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:fieldInfo justification="left" sequence_number="3" />
                      </xs:appinfo>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="UnitPrice" type="xs:decimal">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:fieldInfo justification="left" sequence_number="4" />
                      </xs:appinfo>
                    </xs:annotation>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>

     

    Appreciate your help.

     

    Thanks

    Sam


    red
    Monday, November 8, 2010 8:58 PM

Answers

  • "3. With simple Orchestration contains only Receive and send port assigning same message to both. Used pipe line in Receive port to debatch the message. Max Occurs in schema changes to 1. However, process outputting the message with all 3 records in one XML message. Also noticed that both parent node PRODUCTS is repeated in Child nodes too. It was supposed to be PRODUCT (With out 'S' at the end) ..." MaxOccurs in schema does not force the parser to cut nodes! It is by design. Seems the issue with S is in some error outside of your example. I didn't find anything related to it in your schema.
    Leonid Ganeline [BizTalk MVP] Biztalkien blog
    Friday, November 12, 2010 2:36 AM
    Moderator

All replies

  • Hi Sam,

    There is another trick you can do with WCF-SQL loading flat-file, see this post by Thiago.

    HTH

    Regards,

    Steef-Jan Wiggers
    MVP & MCTS BizTalk Server
    http://soa-thoughts.blogspot.com/
    If this answers your question please mark it accordingly


    BizTalk
    Monday, November 8, 2010 9:40 PM
    Moderator
  • "3. With simple Orchestration contains only Receive and send port assigning same message to both. Used pipe line in Receive port to debatch the message. Max Occurs in schema changes to 1. However, process outputting the message with all 3 records in one XML message. Also noticed that both parent node PRODUCTS is repeated in Child nodes too. It was supposed to be PRODUCT (With out 'S' at the end) ..." MaxOccurs in schema does not force the parser to cut nodes! It is by design. Seems the issue with S is in some error outside of your example. I didn't find anything related to it in your schema.
    Leonid Ganeline [BizTalk MVP] Biztalkien blog
    Friday, November 12, 2010 2:36 AM
    Moderator