locked
Getting the Validation Error Message RRS feed

  • Question

  • I have developed one sample application. This application will validate XMLmessage against schema. If invalid message then the error message need to send  to error folder via File Adapter.

    1.I have configured 2 send ports.one for sucessfullmessage and other for failured messages.

    2. Receive pipeline side I checked 'Enable routing for failed message"

    3. FOr Failed message send port filter, I have mentioned "Error.ErrorType="FailedMessage"

    When I submit the invalid XML , I am not getting following error message details in my error folder.the below message i am expecting in my error folder

    There was a failure executing the receive pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "Pipeline " Receive Port: "RcvTestError" URI: "C:\Filedrop\In\*.xml" Reason: The document failed to validate because of the following error:"The 'ENAME' element has an invalid value according to its data type." . 

    Please help me why i am not getting error message

    Friday, March 8, 2013 3:08 AM

Answers

  • If you want to be able to capture the error message during the message dissembly or parsing stage, you would need to create a custom dissembler (in this case wrap the framework XML dissembler in your custom component) capture the error being thrown, add it to the message or as a message part and set appropriate context properties (you might want to create your own for this purpose) to indicate the state of the parsed message.

    Regards.

    Friday, March 8, 2013 4:38 AM
  • Hi BizQ,

    If you want to receive a message with the details of your validation error, then you need a custom receive pipeline component which extends the XMLValidation pipeline component.

    One of the key things you should also consider in this design is

    By default, the XMLValidation component only notifies you about the very first error message it encounters. For example, if in our input XML message, may have more than one errors like

    • "'ENAME' element has an invalid value according to its data      type."
    • "'LNAME' element has an invalid value according to its data      type."
    • "AddLine1' element has an invalid value according to its data      type".

    your way of validation will only notify you with the first error as you have encountered now. But in real-time, it’s better to identity all the potential validation error in one go.

    Use Saravana's excellent "Extended XmlValidation Pipeline Component". This article also comes with the source which can use or modify based on your requirement.

    This component would solve your problem exactly.

    Regards,

    M.R.ASHWINPRABHU


    If this answers your question please mark it accordingly

    Friday, March 8, 2013 8:46 AM

All replies

  • Hi,

    Try setting the filter on the failed message send port as ErrorReport.ReceivePortName = <Your Receive Port Name>

    This receive port name will the name of the receive port where you are putting the input xml.

    Thanks,

    Sumit

    Sumit Verma - MCTS BizTalk 2006/2010 - Please indicate "Mark as Answer" or "Mark as Helpful" if this post has answered the question

    Friday, March 8, 2013 3:54 AM
  • Now I am getting the Same as Input Message.But I want the out message should contain the above mentioned error description
    Friday, March 8, 2013 4:01 AM
  • If you want to be able to capture the error message during the message dissembly or parsing stage, you would need to create a custom dissembler (in this case wrap the framework XML dissembler in your custom component) capture the error being thrown, add it to the message or as a message part and set appropriate context properties (you might want to create your own for this purpose) to indicate the state of the parsed message.

    Regards.

    Friday, March 8, 2013 4:38 AM
  • Hi,

    In order to capture the exact error message, you will have to use the context Property - ErrorReport.Description in a custom component.

    Thanks,

    Sumit


    Sumit Verma - MCTS BizTalk 2006/2010 - Please indicate "Mark as Answer" or "Mark as Helpful" if this post has answered the question

    Friday, March 8, 2013 7:30 AM
  • Hi BizQ,

    If you want to receive a message with the details of your validation error, then you need a custom receive pipeline component which extends the XMLValidation pipeline component.

    One of the key things you should also consider in this design is

    By default, the XMLValidation component only notifies you about the very first error message it encounters. For example, if in our input XML message, may have more than one errors like

    • "'ENAME' element has an invalid value according to its data      type."
    • "'LNAME' element has an invalid value according to its data      type."
    • "AddLine1' element has an invalid value according to its data      type".

    your way of validation will only notify you with the first error as you have encountered now. But in real-time, it’s better to identity all the potential validation error in one go.

    Use Saravana's excellent "Extended XmlValidation Pipeline Component". This article also comes with the source which can use or modify based on your requirement.

    This component would solve your problem exactly.

    Regards,

    M.R.ASHWINPRABHU


    If this answers your question please mark it accordingly

    Friday, March 8, 2013 8:46 AM