Message splitting using XML receive pipeline

 Introduction

In this blog, we will try to understand how we can split messages using an XML receive pipeline.

Steps

  • Create the schema for the split messages and also the envelope schema. Please follow the below steps
  • Create a Racquet Schema in the project. Right Click on the Project --> Add --> New Item --> Schema

    • Let us now create an envelope Schema named 'RacquetsEnvelope'. Right Click on the Project --> Add --> New Item --> Schema
    • Name the root node 'Racquets'
    • Click on Schema node , go to properties and set 'Envelope' to 'Yes'. Go to Imports --> Collections -->
    • Add --> Add the 'Racquet' schema



    • Click on 'Racquets' node and set Body Xpath to '/*[local-name()='Racquets' and namespace-uri()='http://POCSplitMessages.RacquetsEnvelope']'


    • Right-click on the Racquets node and create a child record
    • Click on the child record --> properties --> Data Structure type = ns0:Racquet (Reference)
    • You can select the Data Structure type from the drop-down.
  • Deploy both these schemas
  • Create the bindings

Name of the receive port = POCSplitMessages.ReceiveRacquetsViaXmlReceive.RP

Name of the Receive Location = POCSplitMessages.ReceiveRacquetsViaXmlReceive.RL

URL = D:\Developer\Vipin\POCSplitMessages\ReceiveRacquetsViaXmlReceive\

                    Pipeline = XML Receive pipeline 

Name of the send port = POCSplitMessages.SendRacquetsWithoutOrch.SP

URL = D:\Developer\Vipin\POCSplitMessages\SendRacquetsWithoutOrch

Filter condition= Filter by Receive port "POCSplitMessages.ReceiveRacquetsViaXmlReceive.RP"

Testing

  • Drop the input file in the receive location configured with the XML receive pipeline

<ns0:Racquets xmlns:ns0="http://POCSplitMessages.RacquetsEnvelope">
  <ns1:Racquet xmlns:ns1="http://POCSplitMessages.Racquet">
    <ID>ID_0</ID>
    <Model>Model_0</Model>
    <Brand>Brand_0</Brand>
    <Price>Price_0</Price>
    <Series>Series_0</Series>
    <GripSize>GripSize_0</GripSize>
  </ns1:Racquet>
    <ns1:Racquet xmlns:ns1="http://POCSplitMessages.Racquet">
    <ID>ID_1</ID>
    <Model>Model_1</Model>
    <Brand>Brand_1</Brand>
    <Price>Price_1</Price>
    <Series>Series_1</Series>
    <GripSize>GripSize_1</GripSize>
  </ns1:Racquet>
</ns0:Racquets>

  • You will find that this message will be split into 2 and sent out to the send port file location

Message 1
<ns1:Racquet xmlns:ns1="http://POCSplitMessages.Racquet">
    <ID>ID_1</ID>
    <Model>Model_1</Model>
    <Brand>Brand_1</Brand>
    <Price>Price_1</Price>
    <Series>Series_1</Series>
    <GripSize>GripSize_1</GripSize>
  </ns1:Racquet>

Message 2
<ns1:Racquet xmlns:ns1="http://POCSplitMessages.Racquet">
    <ID>ID_0</ID>
    <Model>Model_0</Model>
    <Brand>Brand_0</Brand>
    <Price>Price_0</Price>
    <Series>Series_0</Series>
    <GripSize>GripSize_0</GripSize>
  </ns1:Racquet>


Comments

Popular posts from this blog

EDI X12 Trading partner configuration in BizTalk

How to create an EDI 850 profile in Boomi?

Basics of Correlation in BizTalk