none
Pool Multiple Messages with BizTalk 2006 SQL Adapter RRS feed

  • Question

  • I have a StoredProcedure that returns a simple table containing several records:

    DECLARE @STEPS_TABLE AS TABLE (OrchestrationID uniqueidentifier, [Message] nvarchar(1000));

    -- LOADING THE VALUES HERE

    SELECT * FROM @STEPS_TABLE As Step FOR XML AUTO, XMLDATA, ELEMENTS

    I used the SQL Transport Schema Generation Wizard to create my schema and could configure the port correctly. If I use this schema on my orchestration, it works perfectly. BizTalk starts one instance of the orchestration everytime the @STEPS_TABLE has more than 1 record.

    Reading Microsoft technical documentation, they recommend to get several messages in one call and then use the XML pipeline to disassemble the multi-row BizTalk message into a single-row BizTalk message.

    I haven't used the XML pipeline before, so I tried the provided steps but couldn't get it to work.

    Could somebody provide me a link to a "how to" (didn't find anything until now, after several hours of searching) or give me some hints to succeed.

    Thanks in advance.

    Tuesday, October 23, 2012 4:08 AM

Answers

  • ... some hours later I could figure it out myself. So if anybody comes across the same issue as me, here you have some guidelines to make it work on your environment.

    At the end I followed a different walkthrough from Microsoft and avoided the pipeline recommendation altogether. The documentation I found is called "Disassembling Result Sets Using the SQL Adapter" and does exactly what i was looking for. You can just follow the whole walkthrough from Microsoft but avoid the creation of the send port and make some little adjustment on the receive port.

    After following the technical document you will end up with two schemas, I will call them message and envelope (contains several messages) for the sake of this excercise. In your orchestration you can create a receiving port that maps to the message and then when you configure it as a SQL Port and you link it to your stored procedure (or select statement), you only have to change the Document Root Element Name to the envelope root name; the XML Receive pipeline (provided by default in BizTalk 2006) will do the magic of disassembling the messages contained in the envelope and instantiating an orchestration for each message.

    The Microsoft "Disassembling Result Sets Using the SQL Adapter" walkthrough can be found under:

    http://msdn.microsoft.com/en-us/library/aa562098(v=bts.20).aspx

    Mission accomplished :)

    Tuesday, October 23, 2012 1:57 PM