BizTalk Server General - BizTalk 2004 :: merging a multiple root node message as output

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > December 2005 > BizTalk 2004 :: merging a multiple root node message as output





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author BizTalk 2004 :: merging a multiple root node message as output
BA

2005-12-28, 7:51 am


Hello,

I have a typical xml message as input (single root node) and I need to map
to a message which contains multiple root nodes. To create this multiple
root node message I am using a multi part map which produces seperate messages,
each with a distinct root node.

The problem is that I need these messages to be joined into 1 single message
(with multiple root nodes) for an external legacy system to process.

The mapper forces me to choose a single root node, and additionally I am
not allowed to even create a message which has more than one root node, so
the question is, what is the best way to join them?

My conclusion is a bit of custom code which gets all the different messages
as input and joins them together as one single xml message output. Then
I can create a generic message type (xmlDocument) and assign it to the component's
output and deliver a generic message as output.

The schema, which contains multiple elements at the root, is similar to:

<root1>
<nodes>
</root1>
<root2>
<nodes>
</root2>
<root3>
<nodes>
</root3>

Can anyone advise me on a non-custom way to merge these messages into one?
My client frowns on having any custom code in BizTalk applications. If
there simply isn't one, tell me that, I could use some guidance.

Cheers,
BA


Scott Colestock

2005-12-28, 5:57 pm

One of the rules of well-formed xml is the presence of a single root node.
(That is why the mapper creates a "wrapper" element around multiple-input
maps.)

If you really have a legacy system that is not using well-formed xml (or
expects multiple messages in a single transport payload) I would think a
custom pipeline might be the best solution. You could strip off the wrapper
element at that point manually. But make sure this is what you really
want...No standard xml processing tools would deal with the resulting
content very well.

Scott Colestock
www.traceofthought.net



"BA" <biztalk.architect@gmail.com> wrote in message
news:7127ff7bbf258c7d9cc9325f02b@news.microsoft.com...
>
> Hello,
>
> I have a typical xml message as input (single root node) and I need to map
> to a message which contains multiple root nodes. To create this multiple
> root node message I am using a multi part map which produces seperate
> messages, each with a distinct root node.
>
> The problem is that I need these messages to be joined into 1 single
> message (with multiple root nodes) for an external legacy system to
> process.
>
> The mapper forces me to choose a single root node, and additionally I am
> not allowed to even create a message which has more than one root node, so
> the question is, what is the best way to join them?
>
> My conclusion is a bit of custom code which gets all the different
> messages as input and joins them together as one single xml message
> output. Then I can create a generic message type (xmlDocument) and assign
> it to the component's output and deliver a generic message as output.
> The schema, which contains multiple elements at the root, is similar to:
>
> <root1>
> <nodes>
> </root1>
> <root2>
> <nodes>
> </root2>
> <root3>
> <nodes>
> </root3>
>
> Can anyone advise me on a non-custom way to merge these messages into one?
> My client frowns on having any custom code in BizTalk applications. If
> there simply isn't one, tell me that, I could use some guidance.
>
> Cheers,
> BA
>
>



BA

2005-12-28, 5:58 pm

Hello Scott,

Thanks for the response.

I mentioned a custom component called within the orchestration because the
output of the mapper is 4 different messages. How can I pass all 4 to a
custom pipeline at the same time?

I would much rather use a custom pipeline but I'm confused as how to get
all 4 messages in the pipeline together, wouldn't it invoke the pipeline
4 times?


Cheers and thanks,

BA
http://biztalkia.blogspot.com/

[vbcol=seagreen]
> One of the rules of well-formed xml is the presence of a single root
> node. (That is why the mapper creates a "wrapper" element around
> multiple-input maps.)
>
> If you really have a legacy system that is not using well-formed xml
> (or expects multiple messages in a single transport payload) I would
> think a custom pipeline might be the best solution. You could strip
> off the wrapper element at that point manually. But make sure this is
> what you really want...No standard xml processing tools would deal
> with the resulting content very well.
>
> Scott Colestock
> www.traceofthought.net
> "BA" <biztalk.architect@gmail.com> wrote in message
> news:7127ff7bbf258c7d9cc9325f02b@news.microsoft.com...
>


Scott Colestock

2005-12-28, 5:58 pm

Well, you could have your map create a single output message (based on
multiple inputs). The transform shape will do "n-to-1" mappings, as far as
I know. Then, you will have a single message destined for your pipeline...

Scott Colestock
www.traceofthought.net

"BA" <biztalk.architect@gmail.com> wrote in message
news:7127ff7bbf318c7d9e24a746cf7@news.microsoft.com...
> Hello Scott,
>
> Thanks for the response.
>
> I mentioned a custom component called within the orchestration because the
> output of the mapper is 4 different messages. How can I pass all 4 to a
> custom pipeline at the same time?
>
> I would much rather use a custom pipeline but I'm confused as how to get
> all 4 messages in the pipeline together, wouldn't it invoke the pipeline 4
> times?
>
>
> Cheers and thanks,
>
> BA
> http://biztalkia.blogspot.com/
>
>
>
>



BA

2005-12-29, 7:49 am

Hello Scott,

The destination schema has multiple root nodes which forces me to make an
"n-to-n" mapping. I am left with 4 seperate messages upon completion of
the mapping which I cant pass together to a pipeline.

I could create a new schema which holds the current XSD's multiple root nodes
with a single root node and then modify the xml in the pipeline by, in essence,
stripping the root node out. That would give me the end result I am looking
for but in that case I could just use that new XSD as the destination mapping
and achieve an "n-to-1" mapping.

BA
http://biztalkia.blogspot.com

[vbcol=seagreen]
> Well, you could have your map create a single output message (based on
> multiple inputs). The transform shape will do "n-to-1" mappings, as
> far as I know. Then, you will have a single message destined for your
> pipeline...
>
> Scott Colestock
> www.traceofthought.net
> "BA" <biztalk.architect@gmail.com> wrote in message
> news:7127ff7bbf318c7d9e24a746cf7@news.microsoft.com...
>


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com