locked
Message Validation & Canonical Translation RRS feed

  • Question

  • Hi

      We have a requirement where we receive 8 csv files and translate into canonical message.  I have some questions related to validating source message.

    1. Dissemble Stage:  I have written a custom pipeline to handle any csv (dynamically load schema details) to an xml. 
    2. Validation: I’m planning to write one more component to validate source message against the schema but what’s the best approach? Should I validate in the pipeline or translate the source message into a canonical message and send into a message box and calling a .NET component to validate the canonical message inside a orchestration which subscribe to a message?

       

    1. Another question I do have is, is it best practice to let the custom pipeline to translate the source message into a canonical message (XSLTTransform .NET)   Or call translation (Map).  If translation then which stage do we need to call and it should be dynamic

     

    Tuesday, January 15, 2013 1:57 PM

Answers

  • IMO,

    for your points

    1. Validation-I will validate the message in pipeline and report any validation failure( using a custom error message with the validation errors) to message box, I will avoid to pass incorrect message to BizTalk message Box.

    2- Transformation-> I will use the Map . If you need dynamic then you can also call the MAP ( using .net class) in the pipeline after your validation. If it is not dynamic then you can setup the MAP on the receive port.

    In summary following options

    a. Use .net method to call the map in pipeline component once the validation is passed.

    b. Use the map on the receive port, which gives an option to change the MAP on deployment time.

    c. You can again call the map using transformation shape OR using .net method in Orchestration to transform your message.

    I would try to use XSLT Transform. But if nothing above suits my requirement then I would try this option also. It will be faster though IMHO .

    I hope this helps.  


    HTH,
    Naushad Alam

    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer
    alamnaushad.wordpress.com

    Tuesday, January 15, 2013 2:06 PM
    Moderator

All replies

  • IMO,

    for your points

    1. Validation-I will validate the message in pipeline and report any validation failure( using a custom error message with the validation errors) to message box, I will avoid to pass incorrect message to BizTalk message Box.

    2- Transformation-> I will use the Map . If you need dynamic then you can also call the MAP ( using .net class) in the pipeline after your validation. If it is not dynamic then you can setup the MAP on the receive port.

    In summary following options

    a. Use .net method to call the map in pipeline component once the validation is passed.

    b. Use the map on the receive port, which gives an option to change the MAP on deployment time.

    c. You can again call the map using transformation shape OR using .net method in Orchestration to transform your message.

    I would try to use XSLT Transform. But if nothing above suits my requirement then I would try this option also. It will be faster though IMHO .

    I hope this helps.  


    HTH,
    Naushad Alam

    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer
    alamnaushad.wordpress.com

    Tuesday, January 15, 2013 2:06 PM
    Moderator
  • Validation: I would validate the source message as it is originating from elsewhere.

    Translation: It is possible to configure the multiple maps at port level and there is no need for a custom pipeline component. The map that matches the source schema would be chosen for transformation. Obvisouly, as no custom component is being used it would perform better as well.


    Thanks, Murugesan M - Please Mark as the Answer, if this answers your question. Please vote as helpful, if this post is helpful.

    Tuesday, January 15, 2013 2:17 PM
  • 1.Write one custom pipeline component converting CSV file to XML.

    2.Write one custom pipeline component for validating the message

    or

    If each CSV file have different business logic then perform the validation against the schema in Orchestration 

    3.through dynamic  mapping convert source schema to canonical schema

    Regards,

    Kapil.

    Tuesday, January 15, 2013 2:58 PM
  • Sorry I missread your post.  If Leonid's post (below) doesn't work, you can wrap the BizTalk flat file disassembler and align to the appropriate schema using your own match logic.  A sample custom flat file disassembler that uses the BizTalk flat file disassembler can be downloaded from http://code.msdn.microsoft.com/BizTalk-Trailer-Preserving-fbe4a87a ... with just a few modifications and your own matching logic it should satisfy your needs.


    David Downing... If this answers your question, please Mark as the Answer. If this post is helpful, please vote as helpful.



    Tuesday, January 15, 2013 3:47 PM
  • It can be done in one pipeline (possible). Include 4 FF Disassembler components in this pipe. Add a XML Validator  component with 4 Xml schemas.

    Your FF schemas should be different of each other enough that the FF Disassembler could recognize and choose the right schema. In my practice it is not working every time. So test it thoroughly. 

    This solution would be simple enough.

    BTW Do not overestimate the canonical model. It is used to decrease the possibility of modifying too many parts of app if there is a requirement to modify one schema. It should, on theory, to decouple schemas of one party from the schemas of another party. In practice is works but rarely. But it always ads the complexity.


    Leonid Ganeline [BizTalk MVP] BizTalk: Internals: Namespaces

    Tuesday, January 15, 2013 4:08 PM
    Moderator