none
Debatch message and retain parent node

    Question

  • Gurus,
    I receive a message as shown below and I want to debatch and generate four messages out of this one message. I want to retain the "ParentNode" and its attributes in each of the debatched messages. I want to keep this a messaging only solution so don't want to introduce an orchestration. Open to any ideas\suggestions

    Message being received
    <ParentNode TransactionIdentifier="1234">
     <ChildNode></ChildNode>
     <ChildNode></ChildNode>
     <ChildNode></ChildNode>
     <ChildNode></ChildNode>
    </ParentNode>

    Messages desired
    <ParentNode TransactionIdentifier="1234">
     <ChildNode></ChildNode>
    </ParentNode>
    <ParentNode TransactionIdentifier="1234">
     <ChildNode></ChildNode>
    </ParentNode>
    <ParentNode TransactionIdentifier="1234">
     <ChildNode></ChildNode>
    </ParentNode>

    <ParentNode TransactionIdentifier="1234">
     <ChildNode></ChildNode>
    </ParentNode>

    I have tried the sample posted by Johns-305 at this link but the map fails in the receive location because the target schema of the map is marked as envelope.
    https://social.technet.microsoft.com/wiki/contents/articles/32744.biztalk-preserve-xml-header-when-debatching.aspx
    Thursday, July 20, 2017 3:19 PM

All replies

  • I have tried the sample posted by Johns-305 at this link but the map fails in the receive location because the target schema of the map is marked as envelope.

    Hmm...that shouldn't matter. What is the error message?

    But, more important, there is nothing wrong with using an Orchestration.  In this case, that is the correct and best way to get the desired results.

    Thursday, July 20, 2017 4:32 PM
    Moderator
  • Johns-305,

    Below is the error. And it does not make sense because I have verified the schema is in the application. Now if I change the schema by setting the Envelope to No I don't get any errors but I don't achieve debatching either. I think using a map on the receive part where either the source or target schema is marked as envelope is causing this issue.

    The Messaging Engine failed while executing the inbound map for the message coming from source URL:"C:\Ports\DebatchXmlWithHeader\Receive\*.xml" with the Message Type "http://DebatchXmlWithHeader.MessageWithHeader#IncomingMessage". Details:"Document type "http://DebatchXmlWithHeader.MessageWithHeader#IncomingMessage" does not match any of the given schemas. "

    Thursday, July 20, 2017 4:40 PM
  • Well, it shouldn't matter if they explicitly set in the XmlDisassembler...but...

    You can't get what you want in a messaging only solution without at least two custom Pipeline Components.

    I strongly recommend you follow my example in the Article using an Orchestration.  You'd probably already be done!

    Thursday, July 20, 2017 5:03 PM
    Moderator
  • If you're looking for a message only solution please have a look the Envelope Processing sample in the SDK

    EDIT: Ups this is only for flat files ...

    /Peter



    Saturday, July 22, 2017 10:27 AM