Incorrect validation error message when using the default XMLReceive pipeline in BizTalk 2013

By vincent

At my
current project we are migrating from BizTalk Server 2009 to BizTalk Server
2013. We had a few interfaces using the default XMLReceive pipeline for the validation
of incoming messages. These interfaces had BizUnit tests, that would check the
Error Message in the Error Portal. After the migration, these tests failed,
because the Error Message was different. We found that the error was not what
we expected and was incorrect.

Below an
example to show the behavior we found:

A simple
schema had been defined, with three string elements: FieldA, FieldB and FieldC.
FieldB has a maximum length of 5 characters.

This schema
has been deployed to BizTalk and a FILE receive location is created. This
location uses the default XMLReceive pipeline with validation enabled and the
fully qualified name of the schema set at the DocumentSpecNames.

The
following message will be used to test the validation. FieldB had been filled
with a value of eight characters (which is three too many).

We would expect BizTalk to give the following
error message:

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:
“ValidationReceiveError” URI:
“C:FiledropValidationReceiveErrorIN* – Copy.xml” Reason: The XML
Validator failed to validate.
Reason: The document failed to validate because of the following error:”The ‘FieldB’ element has an invalid value according to its data type.” .

Instead, we
receive the following error message:

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:
“ValidationReceiveError” URI:
“C:FiledropValidationReceiveErrorIN* – Copy.xml
Reason: The document failed to validate because of the following
error:”The element ‘FieldB’ cannot contain child element ‘FieldC’ because
the parent element’s content model is text only.” .
 

This
behavior has been found on different BizTalk machines, with and without CU2
installed. We have also tried different types of validation errors and all of
them give a different error message than the actual error in the XML.

Has anyone
found this behavior as well? If we create a custom pipeline with a XML dissassembler
and a XML validator component, we receive the error we expect. We will open a
call with Microsoft and I will update this post if we receive or find a
solution.

Comments: 0

Leave a Reply

Your email address will not be published. Required fields are marked *