Problem regarding xml debatching

Home Page Forums BizTalk 2004 – BizTalk 2010 Problem regarding xml debatching

Viewing 1 reply thread
  • Author
    Posts
    • #21911

      Hi  I want to debatch a xml message according to the records in that message so I read a article of Saravana Kumar and found it has a similar to my requirement but the only difference is I am not creating any envelope schema in my project i just want to debatch from my original message so I am just using that and to send a message from a logical port I am defining it as System.xml.xmlDocument and for me its not working

      http://www.digitaldeposit.net/saravana/post/2006/12/18/Message-Debatching-inside-Biztalk-Orchestration-with-TargetNamespace.aspx

      its giving an error , so do i need to create envelop schema and then follow this article and my message type should be a schema that I have to define

      Uncaught exception (see the ‘inner exception’ below) has suspended an instance of service ‘TEMSInt.TemsOrchestration(10e74d9f-953f-b28d-425d-5fdbee10e5c7)’.

      The service instance will remain suspended until administratively resumed or terminated.

      If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.

      InstanceId: dc12bd5c-5a77-46b7-99c3-d5b44759c308

      Shape name: Expression_3

      ShapeId: 521650df-db94-449a-a210-e7374deea41a

      Exception thrown from: segment 1, progress 21

      Inner exception: Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function.

       

      Exception type: XPathException

      Source: System.Xml

      Target Site: MS.Internal.Xml.XPath.Query get_QueryTree()

      The following is a stack trace that identifies the location where the exception occured

      at MS.Internal.Xml.XPath.CompiledXpathExpr.get_QueryTree()

      at System.Xml.XPath.XPathNavigator.Evaluate(XPathExpression expr, XPathNodeIterator context)

      at System.Xml.XPath.XPathNavigator.Evaluate(String xpath)

      at Microsoft.XLANGs.Core.Part.XPathLoad(Part sourcePart, String xpath, Type dstType)

      at TEMSInt.TemsOrchestration.segment1(StopConditions stopOn)

      at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)

       

      Thanks

    • #21919

      Looks like there is a problwm with your Xpath statement in your orchestration. Can you show us the Xpath statement and the schema

      There are many ways of debatching, the most efficient is in the receive pipeline – this requires an envelope.
      However there are some cases where you cannot debatch in the pipeline and you need to debatch inside the orchestration. The most common way of doing this is a looping xpath – this does not require an envelope.

      Can you provide an overview of your solution and why you are debatching in the orchestration instead of the pipeline?

      • #21921

        Hi Thanks for the reply  I am receiving a flatfile msg and after doing some mappings I am transforming that flatfile data into XML message and this XML msg has header,Line and Dist and I need to debatch those records into individual messages, like if there are 2 header records in a .txt file i should have 2 xml msgs for the header and for Line if there are 20 Line then i need to get 20 line messages and like wise to the Dist also so I am implementing the debatch mechanism from the Stephens. Thomas article but I am getting this error. 

         my schema is

        TEMS_SQL>

        <TEMS>
        <Header>
          <BUSINESS_UNIT>SN018</BUSINESS_UNIT>
          <VCHR_BLD_KEY_C1>SN018</VCHR_BLD_KEY_C1>
          <VCHR_BLD_KEY_N1>03162009</VCHR_BLD_KEY_N1>
          <VCHR_BLD_KEY_N2>14:41:28</VCHR_BLD_KEY_N2>
          <VOUCHER_ID>NEXT</VOUCHER_ID>
          <VOUCHER_STYLE>REG</VOUCHER_STYLE>
          <INVOICE_ID>404R285738738_08282008</INVOICE_ID>
          <INVOICE_DT>20080828</INVOICE_DT>
          <VENDOR_SETID>SHARE</VENDOR_SETID>
          <VENDOR_ID>00539</VENDOR_ID>
          <VNDR_LOC>HO1</VNDR_LOC>
          <ADDRESS_SEQ_NUM>REG</ADDRESS_SEQ_NUM>
          <ORIGIN>TEM</ORIGIN>
          <OPRID>APBATCH</OPRID>
          <ACCOUNTING_DT>03162009</ACCOUNTING_DT>
          <GROSS_AMT>33566.39</GROSS_AMT>
          <PYMNT_TERMS_CD>IMMED</PYMNT_TERMS_CD>
          </Header>
        <SubRecord>
        <LINE>
          <BUSINESS_UNIT>SN018</BUSINESS_UNIT>
          <VCHR_BLD_KEY_C1>SN018</VCHR_BLD_KEY_C1>
          <VCHR_BLD_KEY_N1>03162009</VCHR_BLD_KEY_N1>
          <VCHR_BLD_KEY_N2>14:41:28</VCHR_BLD_KEY_N2>
          <VOUCHER_ID>NEXT</VOUCHER_ID>
          <VOUCHER_LINE_NUM>1</VOUCHER_LINE_NUM>
          <DESCR />
          <MERCHANDISE_AMT>49.82</MERCHANDISE_AMT>
          <WTHD_SW>N</WTHD_SW>
          </LINE>
        <LINE>
          <BUSINESS_UNIT>SN018</BUSINESS_UNIT>
          <VCHR_BLD_KEY_C1>SN018</VCHR_BLD_KEY_C1>
          <VCHR_BLD_KEY_N1>03162009</VCHR_BLD_KEY_N1>
          <VCHR_BLD_KEY_N2>14:41:28</VCHR_BLD_KEY_N2>
          <VOUCHER_ID>NEXT</VOUCHER_ID>
          <VOUCHER_LINE_NUM>2</VOUCHER_LINE_NUM>
          <DESCR />
          <MERCHANDISE_AMT>192.19</MERCHANDISE_AMT>
          <WTHD_SW>N</WTHD_SW>
          </LINE>
        <LINE>
          <BUSINESS_UNIT>SN018</BUSINESS_UNIT>
          <VCHR_BLD_KEY_C1>SN018</VCHR_BLD_KEY_C1>
          <VCHR_BLD_KEY_N1>03162009</VCHR_BLD_KEY_N1>
          <VCHR_BLD_KEY_N2>14:41:28</VCHR_BLD_KEY_N2>
          <VOUCHER_ID>NEXT</VOUCHER_ID>
          <VOUCHER_LINE_NUM>3</VOUCHER_LINE_NUM>
          <DESCR />
          <MERCHANDISE_AMT>602.69</MERCHANDISE_AMT>
          <WTHD_SW>N</WTHD_SW>
          </LINE>
        <LINE>
          <BUSINESS_UNIT>SN018</BUSINESS_UNIT>
          <VCHR_BLD_KEY_C1>SN018</VCHR_BLD_KEY_C1>
          <VCHR_BLD_KEY_N1>03162009</VCHR_BLD_KEY_N1>
          <VCHR_BLD_KEY_N2>14:41:28</VCHR_BLD_KEY_N2>
          <VOUCHER_ID>NEXT</VOUCHER_ID>
          <VOUCHER_LINE_NUM>4</VOUCHER_LINE_NUM>
          <DESCR />
          <MERCHANDISE_AMT>237.68</MERCHANDISE_AMT>
          <WTHD_SW>N</WTHD_SW>
          </LINE>
        <Dist>

          <BUSINESS_UNIT>SN018</BUSINESS_UNIT>
          <VCHR_BLD_KEY_C1>SN018</VCHR_BLD_KEY_C1>
          <VCHR_BLD_KEY_N1>03162009</VCHR_BLD_KEY_N1>
          <VCHR_BLD_KEY_N2>14:41:28</VCHR_BLD_KEY_N2>
          <VOUCHER_ID>NEXT</VOUCHER_ID>
          <VOUCHER_LINE_NUM>1</VOUCHER_LINE_NUM>
          <DISTRIB_LINE_NUM>1</DISTRIB_LINE_NUM>
          <BUSINESS_UNIT_GL>SN018</BUSINESS_UNIT_GL>
          <QTY_VCHR>OPTIONAL</QTY_VCHR>
          <MERCHANDISE_AMT>49.82</MERCHANDISE_AMT>
          <PO_DIST_LINE_NUM>OPTIONAL</PO_DIST_LINE_NUM>
          <ACCOUNT>911000</ACCOUNT>
          <DEPTID>9000</DEPTID>
          <CHARTFIELD1>TEM01100</CHARTFIELD1>
          </Dist>
        <Dist>
          <BUSINESS_UNIT>SN018</BUSINESS_UNIT>
          <VCHR_BLD_KEY_C1>SN018</VCHR_BLD_KEY_C1>
          <VCHR_BLD_KEY_N1>03162009</VCHR_BLD_KEY_N1>
          <VCHR_BLD_KEY_N2>14:41:28</VCHR_BLD_KEY_N2>
          <VOUCHER_ID>NEXT</VOUCHER_ID>
          <VOUCHER_LINE_NUM>2</VOUCHER_LINE_NUM>
          <DISTRIB_LINE_NUM>2</DISTRIB_LINE_NUM>
          <BUSINESS_UNIT_GL>SN008</BUSINESS_UNIT_GL>
          <QTY_VCHR>OPTIONAL</QTY_VCHR>
          <MERCHANDISE_AMT>192.19</MERCHANDISE_AMT>
          <PO_DIST_LINE_NUM>OPTIONAL</PO_DIST_LINE_NUM>
          <ACCOUNT>911000</ACCOUNT>
          <DEPTID>9000</DEPTID>
          <CHARTFIELD1>TEM01100</CHARTFIELD1>
          </Dist>
        <Dist>
          <BUSINESS_UNIT>SN018</BUSINESS_UNIT>
          <VCHR_BLD_KEY_C1>SN018</VCHR_BLD_KEY_C1>
          <VCHR_BLD_KEY_N1>03162009</VCHR_BLD_KEY_N1>
          <VCHR_BLD_KEY_N2>14:41:28</VCHR_BLD_KEY_N2>
          <VOUCHER_ID>NEXT</VOUCHER_ID>
          <VOUCHER_LINE_NUM>3</VOUCHER_LINE_NUM>
          <DISTRIB_LINE_NUM>3</DISTRIB_LINE_NUM>
          <BUSINESS_UNIT_GL>SN053</BUSINESS_UNIT_GL>
          <QTY_VCHR>OPTIONAL</QTY_VCHR>
          <MERCHANDISE_AMT>602.69</MERCHANDISE_AMT>
          <PO_DIST_LINE_NUM>OPTIONAL</PO_DIST_LINE_NUM>
          <ACCOUNT>911000</ACCOUNT>
          <DEPTID>9000</DEPTID>
          <CHARTFIELD1>TEM01100</CHARTFIELD1>
          </Dist>
        <Dist>
          <BUSINESS_UNIT>SN018</BUSINESS_UNIT>
          <VCHR_BLD_KEY_C1>SN018</VCHR_BLD_KEY_C1>
          <VCHR_BLD_KEY_N1>03162009</VCHR_BLD_KEY_N1>
          <VCHR_BLD_KEY_N2>14:41:28</VCHR_BLD_KEY_N2>
          <VOUCHER_ID>NEXT</VOUCHER_ID>
          <VOUCHER_LINE_NUM>4</VOUCHER_LINE_NUM>
          <DISTRIB_LINE_NUM>4</DISTRIB_LINE_NUM>
          <BUSINESS_UNIT_GL>SN008</BUSINESS_UNIT_GL>
          <QTY_VCHR>OPTIONAL</QTY_VCHR>
          <MERCHANDISE_AMT>237.68</MERCHANDISE_AMT>
          <PO_DIST_LINE_NUM>OPTIONAL</PO_DIST_LINE_NUM>
          <ACCOUNT>911000</ACCOUNT>
          <DEPTID>9000</DEPTID>
          <CHARTFIELD1>TEM01100</CHARTFIELD1>
          </Dist>
        <Dist>
          <BUSINESS_UNIT>SN018</BUSINESS_UNIT>
          <VCHR_BLD_KEY_C1>SN018</VCHR_BLD_KEY_C1>
          <VCHR_BLD_KEY_N1>03162009</VCHR_BLD_KEY_N1>
          <VCHR_BLD_KEY_N2>14:41:28</VCHR_BLD_KEY_N2>
          <VOUCHER_ID>NEXT</VOUCHER_ID>
          <VOUCHER_LINE_NUM>5</VOUCHER_LINE_NUM>
          <DISTRIB_LINE_NUM>5</DISTRIB_LINE_NUM>
          <BUSINESS_UNIT_GL>SN020</BUSINESS_UNIT_GL>
          <QTY_VCHR>OPTIONAL</QTY_VCHR>
          <MERCHANDISE_AMT>1157.64</MERCHANDISE_AMT>
          <PO_DIST_LINE_NUM>OPTIONAL</PO_DIST_LINE_NUM>
          <ACCOUNT>911000</ACCOUNT>
          <DEPTID>9000</DEPTID>
          <CHARTFIELD1>TEM01100</CHARTFIELD1>
          </Dist>
        so now I have to debatch Header,line and Dist into single messages
        what I am doing in the orchestration is  For Header
        Expression shape: 

        HeaderCount = System.Convert.ToInt32(xpath(SQLMessage, “count(//Header)”));

        in the message assignment shape:

        Variable_3 = System.String.Format(“//Header[{0}]”,HeaderInstance);

        Message_1 = xpath(SQLMessage, Variable_3);

        and I am looping for the multiple header because there a possibility of getting multiple headers in a message.

        I am getting an error in the construct message shape which says:

        Uncaught exception (see the ‘inner exception’ below) has suspended an instance of service ‘TEMSInt.TemsOrchestration(10e74d9f-953f-b28d-425d-5fdbee10e5c7)’.
        The service instance will remain suspended until administratively resumed or terminated.
        If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
        InstanceId: aca1d817-96c0-4154-be0b-10e065b2ebf4
        Shape name: Header
        ShapeId: 83aa2bc8-71b9-412f-8e4a-178c40697408
        Exception thrown from: segment 1, progress 32
        Inner exception: Specified method is not supported.
               
        Exception type: NotSupportedException
        Source: Microsoft.XLANGs.Engine
        Target Site: Microsoft.XLANGs.Core.Value GenericLoadFrom(System.Object)
        The following is a stack trace that identifies the location where the exception occured

           at Microsoft.XLANGs.Core.Part.GenericLoadFrom(Object source)
           at Microsoft.XLANGs.Core.XSDPart.ProtectedLoadFrom(Object source)
           at Microsoft.XLANGs.Core.Part.LoadFrom(Object source)
         

        can you please help me to solve this error.

         

        Thanks

        • #21927

          Looking at the code for Microsoft.XLANGs.Core.Part.GenericLoadFrom(Object source) it will throw a “Specified method not supported error” only if the source argument is a System.Xml.XmlNodeList with more than 1 XmlNode. This is called from Message_1 = xpath(SQLMessage, Variable_3);

          I suspect the xpath function is returning more than one node. What is the HeaderInstance variable and how is it assigned?

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.