locked
validate message after mapping RRS feed

  • Question

  • Hello

    I have an incomming message, which is transformed to my canonical data format. I can validate the incomming message in the receive pipeline (validate stage). After the pipeline, the mapping to the canonical is applied.

    Is it possible to validate my canonical datamodel? I'm in a messaging only scenarion, and so do not use orchestrations.

    Thx

    Friday, April 9, 2010 8:43 AM

Answers

  • Hi,

    You cannot do that easily. At least not in a messaging only scenario. The idea is that if you validate your incoming message to make sure it is valid the mapped destination message (canonical message) will also be valid. If that is not the case it means your map will generate a valid message to an invalid canonical message. This means you will have to look at your map and make sure it can only generate valid output (canonical message).

    If you really want to validate the canonical message you could do the transformation in a custom pipeline component and validate after that in the next pipeline component in the pipeline. This is in some aspects similar to how the ESB toolkit (on-ramp) works.

    Another option is to use an orchestration and do the validation there. Finally you could validate the canonical on the send side pipeline using the XML Validator. This only works if you send out the canonical format which is unlikely.

     

     

     


    HTH,

    Randal van Splunteren - MVP, MCTS BizTalk Server
    http://biztalkmessages.vansplunteren.net

    Please mark as answered if this answers your question.

    Check out the PowerShell provider for BizTalk: http://psbiztalk.codeplex.com
    • Proposed as answer by Nikhil J Friday, April 9, 2010 2:20 PM
    • Marked as answer by rdroel Wednesday, April 14, 2010 9:26 AM
    Friday, April 9, 2010 10:57 AM
    Moderator
  • I also agree with Randal, those are the usual places to do the validation after the map.

    Since you are using a messaging only solution I take it you have an extra concern about the performance of the solution. In that case I would recommend checking out this post by Paolo Salvatori (Microsoft BizTalk Customer Advisory Team) and using his 'Transform Pipeline Component' followed by the out of the box XML Validator pipeline component on your receive location.

    http://blogs.msdn.com/paolos/archive/2010/01/29/how-to-boost-message-transformations-using-the-xslcompiledtransform-class.aspx

    Regards, 


    Thiago Almeida - http://connectedthoughts.wordpress.com
    Tuesday, April 13, 2010 6:14 AM
    Answerer

All replies

  • Yes it is possible. Did you face any issue or you are going to use?


    Thanks, Raja
    Friday, April 9, 2010 8:50 AM
  • My question is: can I validate a message, directly after a mapping is applied. If so, how?

    Friday, April 9, 2010 8:58 AM
  • For incoming message Maps are applied after execution of pipeline. and for outgoing message maps are applied first than pipeline.

    Can you not use Validator components? XMLValidator or your own validator inside the custom pipeline?

     


    Please mark it as Answer if this answers your question
    Thanks.
    Mo
    Friday, April 9, 2010 9:05 AM
  • Using BizTalk ESB toolkit, you could apply the rule based routing/validation [BRE] on the validated message.
    Thanks, Raja
    Friday, April 9, 2010 9:10 AM
  • I want to validate the message after the map is applied (so after pipeline execution). I know you can validate incomming messages in the pipeline. But what if you transform that incomming message to a canonical format (after pipeline execution). How can you validate this canonical message?
    • Marked as answer by rdroel Wednesday, April 14, 2010 9:25 AM
    • Unmarked as answer by rdroel Wednesday, April 14, 2010 9:26 AM
    Friday, April 9, 2010 9:13 AM
  • Hi,

    You cannot do that easily. At least not in a messaging only scenario. The idea is that if you validate your incoming message to make sure it is valid the mapped destination message (canonical message) will also be valid. If that is not the case it means your map will generate a valid message to an invalid canonical message. This means you will have to look at your map and make sure it can only generate valid output (canonical message).

    If you really want to validate the canonical message you could do the transformation in a custom pipeline component and validate after that in the next pipeline component in the pipeline. This is in some aspects similar to how the ESB toolkit (on-ramp) works.

    Another option is to use an orchestration and do the validation there. Finally you could validate the canonical on the send side pipeline using the XML Validator. This only works if you send out the canonical format which is unlikely.

     

     

     


    HTH,

    Randal van Splunteren - MVP, MCTS BizTalk Server
    http://biztalkmessages.vansplunteren.net

    Please mark as answered if this answers your question.

    Check out the PowerShell provider for BizTalk: http://psbiztalk.codeplex.com
    • Proposed as answer by Nikhil J Friday, April 9, 2010 2:20 PM
    • Marked as answer by rdroel Wednesday, April 14, 2010 9:26 AM
    Friday, April 9, 2010 10:57 AM
    Moderator
  • Hi,

    You can map your message to a conical format and publish it to the MsgBox than have subcription on new message using send port with filter expression. In send port you can use XML-Validator component. That way your message (canonical gets validated) and send if correct and placed in suspended if not. That way you work completely message-based.

    Cheers,

    Steef-Jan Wiggers
    MCTS BizTalk Server
    http://soa-thoughts.blogspot.com/
    If this answers your question please mark it accordingly


    BizTalk
    Friday, April 9, 2010 3:45 PM
    Moderator
  • hi,

    Enable validation check in map properties in visual studio so that the message can be validated as per the output schema.And if there is any error you can then handle the exception

    For a messaging only scenario follow steef or Randal suggestions

     

    Thanks

    Friday, April 9, 2010 7:37 PM
  • I also agree with Randal, those are the usual places to do the validation after the map.

    Since you are using a messaging only solution I take it you have an extra concern about the performance of the solution. In that case I would recommend checking out this post by Paolo Salvatori (Microsoft BizTalk Customer Advisory Team) and using his 'Transform Pipeline Component' followed by the out of the box XML Validator pipeline component on your receive location.

    http://blogs.msdn.com/paolos/archive/2010/01/29/how-to-boost-message-transformations-using-the-xslcompiledtransform-class.aspx

    Regards, 


    Thiago Almeida - http://connectedthoughts.wordpress.com
    Tuesday, April 13, 2010 6:14 AM
    Answerer
  • Thiago this post is awesome!  I can't believe I hadn't read this yet... or thought to do it myself.  When .NET 2.0 came out I had a lot of code I'd made using XslTransform and outside of BizTalk it was almost all eventually migrated out to great benefit. 

    Thanks!

    -Dan

    Tuesday, April 13, 2010 2:45 PM
  • Yeah Dan, that is a great post by Paolo. XslCompiledTransform is the way to go it seems :)

    Thiago Almeida - http://connectedthoughts.wordpress.com
    Tuesday, April 13, 2010 8:35 PM
    Answerer