Geeks With Blogs
Dot Net Dunk Wandering in the land of .NET

An interesting scenario came up this afternoon. I receive a bunch of different documents containing address changes, which I map to my canonical "address changes" format in the receive port. I then want to split my canonical document using an envelope so that each address change record is out on its own.

As far as I can see, to do this I'm going to have to write the canonicalised document out to disk, then read it back in from disk and split it in the corresponding receive pipeline. This feels awfully inefficient, but luckily it's only for a demo system.

I know that the messagebox allows for far more sophisticated subscriptions than are exposed through the User Interface, and obviously orchestrations can subscribe based just on document type, but does anyone know of an equivalent to "The Messagebox" as a receive location transport type?

On a side note, the lack of blogging recently is entirely down to being on holiday, and an addiction to Halo 2 on XBox Live :-) If anyone fancies a game, invite me over to your party - the gamertag is "shelfsider". I'm varying between level 3 and 5 depending on the gamemode, so not too tough an opponent!


Thanks to my colleague Charles and to Berneba (via comments) for the suggestion of using a loopback adapter. In this case it's probably not going to work as I'm trying to split the document and it's not clear what I'd receive back into the orchestration.

For the purposes of the demo system I'll stick with taking a hop onto the disk, but Darren Jefford's post about looping gives some good ideas - particularly using the little known xpath function.

Posted on Monday, December 6, 2004 4:32 PM BizTalk Server | Back to top

Comments on this post: Document splitting post-receive

# re: Document splitting post-receive
Requesting Gravatar...
Someone wrote a Loopback Adapter for BT04. Is that what you would need to execute an extra receive pipeline with the envelope and split stuff?
Left by Bernabe on Dec 06, 2004 4:58 PM

# re: Document splitting post-receive
Requesting Gravatar...

It is strange that the xpath function in orchestrations is not better known. Next time you create an expression shape, you will see several examples of how to write an expression at the top of the dialogue box. Included is an example of the xpath function... right there in your face, hiding in plain sight. I had not spotted it until recently! Although this example is fab for putting it to good use:

Left by James Saull on Dec 08, 2004 8:50 PM

# re: Document splitting post-receive
Requesting Gravatar...
Stephen Thomas blogged over the weekend on this subject - he did a performance comparison of various approaches to to shredding/de-batching/disassembling(whatever). His tests suggested that the xpath function, for all its power and flexibility, is actually very slow, although it remains his favourite approach.

On the project I'm current working on, we shred messages by iterating over a node list within an orchestration (one of Stephen's approaches). The main reason for doing this is that the XML message is 'anonymous' (no namspaces), and has a document element named 'Response'. We can't change this. The XML is delivered via a web method wich returns strings. I really wanted to avoid, at all costs, having to creat a schema for this horrible XML, which I would have had to do in order to use the XmlDisassembler in a pipeline. I could forsee the possibility of future integration requiring conflicting schemas for other types of response message.

The approach works really well. Each shredded message is constructed with an envelope that provides a default namespace and then delivered back to the message box where it is correlated onto another (calling) orchestration. I use a context property to indicate the last message in the batch.

Just to say again - there is no way you can have a receive port subscribe directly to the messagebox - there is no mechanism for this in BizTalk. Loopback adapters are the closest you can get to the model you are looking for.
Left by Charles Young on Dec 13, 2004 11:31 PM

# re: Document splitting post-receive
Requesting Gravatar...
have you looked at vtd-xml
Left by Jzhang on Nov 25, 2009 7:15 PM

Your comment:
 (will show your gravatar)

Copyright © Duncan Millard | Powered by: