26 July, 2010

Document structure validation and routing failed messages

A nice way of validating the document structure of an incoming message is to use a receive pipeline with both a disassembler component (which validates the structure) and a validation component (which apparently validates the message against any restrictions in the schema).

Configure your receive location to use this pipeline and check "enable routing for failed messages" on the receive port.

Now you can set up a send port (or whatever you need to handle invalid messages), which subscribes to messages with an ErrorReport.ReceivePortName = your receive port, ErrorReport.ErrorType = 'FailedMessage' and ErrorReport.FailureCategory = (you may need to do some testing to see what the appropriate categories are - the ErrorReport options are promoted properties on the failed message) and send an email alert or set up an error-handling orchestration etc.

No comments:

Post a Comment