1

I have a sales order orchestration that sends order messages to a SOAP service. The message contains the order header elements as well as a repeating set of order line items. Example:

<Order>
   <Customer>cust123</Customer>
   <Foo>bar</Foo>
   <OrderLines>
      <Line>
         <ItemSku>123134</ItemSku>
         <Quantity>5</Quantity>
      </Line>
      <Line>
         <ItemSku>56789</ItemSku>
         <Quantity>8</Quantity>
      </Line>
   </OrderLines>
</Order>

I need to introduce a "backup plan" for when the SOAP call fails (whatever the reason may be, e.g. network issues, etc.). I've been asked to take the XML message and convert into a set of flat files (pipe delimited) that represent the order header and order lines, and then send the file to a share which will be swept on a schedule by another process that imports into the same backend system as the SOAP service.

In other words, I need to shred/split the XML up into separate files, since one file is used for the order header, and another is used for the order line items. Note that my actual scenario has other files that are repeating nodes in the order as well but the scenario is exactly as the order line items, so I've kept it simple here.

I've seen a lot of posts talking about debatching, etc, but none of them seem to fit the scenario described above.

What is the best way to accomplish this in BizTalk 2013 R2? Can it be something done at the Send Port, or does this involve custom coding? Please provide steps, and also if possible a link to any related articles resources. Thanks!

Thiago Silva
  • 6,354
  • 2
  • 26
  • 38

1 Answers1

4

It can be done at the send port level.

Have two new ports subscribing to the message.

Have one with a map that maps to your flat file header schema and a pipeline to assemble the header flat file

Have the second port that maps the order lines to your details order lines flat file schema and a pipeline to assemble the details flat file.

Then, it is just a matter of publishing the message to the message box when the SOAP one fails. This you would probably have to do in an Orchestration with a decision shape.

Thiago Silva
  • 6,354
  • 2
  • 26
  • 38
Dijkgraaf
  • 9,324
  • 15
  • 34
  • 48
  • That sounds like a great idea! I'll try it out and report the findings soon. Thanks! – Thiago Silva Aug 26 '15 at 18:50
  • 1
    You might be able to avoid using an orchestration if you set "Enable routing for failed messages" on your SOAP send port and add "ErrorReport.FailureCode - Exists" to the two new file send ports. – Bert Aug 27 '15 at 06:16
  • 1
    @Bert I still need an orchestration, as I am doing other things besides sending this sales order message. The original post was simplified to only include details related to scenario at hand. But it's good to keep in mind that i could use failed msg routing in the future. Thanks! – Thiago Silva Aug 27 '15 at 15:37