views:

167

answers:

1

I have found some broken threads across the web where people claim to be able to use receive shapes in an orchestration with XLANGMessage types to receive flat file schema files that could not be assembled into a specific xsd.

I've attempted to set the messagetype in the receive shape as Microsoft.XLANGS.BaseTypes.XLANGMessage, but this basetype is not serializable. This then causes a build error.

Is there an object type that can capture both XmlDocuments of well formed xml messages as well as malformed xml and non-assembled flat files?

A: 

In answer to your direct question in bold - yes, the type you are after is System.Xml.XmlDocument.

What you need to do is create a new message and when selecting its type, select the above type from the .NET Classes section.

This message when assigned to a receive shape can then receive any payload, for example, I've often used this to pass formats such as .pdf files through BizTalk where I had no need to parse them. Do be aware, however, that despite the name, what you have here is not Xml and will cause you all sorts of issues if you try and treat is as such.


To dig a little further into your question - are you trying to make some sort of error handling orchestration?

If you are then in your error handling code you can just have a recieve shape that receives a message of type XmlDocument with its filter expression set to ErrorReport.ErrorType == "FailedMessage" that is bound to a direct bound port attached to the Message Box.

I've often found it handy to have two receive shapes, one to catch routing failures, when we have any possible payload, and another to subscribe to a strongly types fault wrapper envelope that you define and pass out of your other orchestrations from their CatchException shapes.

This means that you can then build one centralised place to handle all exceptions.


If you haven't seen it, there is a nice post by Charles Young that may describe something similar to what you are trying to do.

David Hall