BizTalk Server General - Mapping creates invalid document and not exception gets thrown

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > June 2006 > Mapping creates invalid document and not exception gets thrown





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Mapping creates invalid document and not exception gets thrown
Alex

2006-06-22, 1:21 pm

Hello !

In my BizTalk 2006 solution I use dynamic mapping to map certain input
XML documents to other XML documents. The reason why I use dynamic
mapping is that I have to deliver XML documents(BMECat - catalogs) to
customers that have the same namespace and the same root element but
the documents differ from customer to customer. Some customers define
XML nodes as mandatory while other limit some values to certain length
because their ERP systems don't support longer values and so on.

To sum up I have many documents that differ from each other with the
same namespace and root element. Not nice ! ;-)

In a BizTalk Map I map the values from a standard Xml document to the
set of customer specific documents. For each of these documents I
have/will specifiy a schema and a map that describe the specifics.

To avoid confilcts in the BTS MessageBox I decided not to deploy the
schemas to the BTS. Instead I install them manually in the GAC. In my
orchestration I uses dynamic mapping and a .NET component that returns
the type from the map via reflection.

All works fine except that my map produces invalid XML document when it
gets executed if the source document doesn't contain all need
information that has to be mapped to the customer XML document. I
thought this would throw an exception and some error message would be
created by the BTS run-time. My plan was to subscribe to these error
messages and if any was created I will sent it via an other
orchestration to a MSMQ. An administrator will get some tool to watch
all errors and he would be able to react on such a failure.

But unfortunately BTS doesn't create such an error message. Why not? In
the internet you find many resources that describe this behaiviour. Any
ideas? If not I have to change my solution so I want to be sure that I
didn't miss some important point.


Thanks!
Alex

Greg Forsythe

2006-06-22, 7:19 pm

The map just performs a transformation. XSLT 1.0 is not schema aware so does
not know whether the input or output documents are valid.
When using the VS.NET Test Map function a XML Schema validation is
explicitly performed on the input and output document, this does not happen
at runtime.

You need to explicitly add a Validation Step.
You could validate once on input, but this could prove tricky as the
minOccurs attribute of some fields differs.
Alternatively you could validate on output.
You cannot use the standard XML Validator pipeline component as this
requires the schemas to be loaded in Biztalk.
You will need to create your own custom validation step in the orchestration
after the map. Either using a custom C# library to perform Xml Schema
validation or use another map(custom XSLT) to implement a Schematron type
validation.

Greg

"Alex" <alex_doehling@web.de> wrote in message
news:1150984596.171107.246260@r2g2000cwb.googlegroups.com...
> Hello !
>
> In my BizTalk 2006 solution I use dynamic mapping to map certain input
> XML documents to other XML documents. The reason why I use dynamic
> mapping is that I have to deliver XML documents(BMECat - catalogs) to
> customers that have the same namespace and the same root element but
> the documents differ from customer to customer. Some customers define
> XML nodes as mandatory while other limit some values to certain length
> because their ERP systems don't support longer values and so on.
>
> To sum up I have many documents that differ from each other with the
> same namespace and root element. Not nice ! ;-)
>
> In a BizTalk Map I map the values from a standard Xml document to the
> set of customer specific documents. For each of these documents I
> have/will specifiy a schema and a map that describe the specifics.
>
> To avoid confilcts in the BTS MessageBox I decided not to deploy the
> schemas to the BTS. Instead I install them manually in the GAC. In my
> orchestration I uses dynamic mapping and a .NET component that returns
> the type from the map via reflection.
>
> All works fine except that my map produces invalid XML document when it
> gets executed if the source document doesn't contain all need
> information that has to be mapped to the customer XML document. I
> thought this would throw an exception and some error message would be
> created by the BTS run-time. My plan was to subscribe to these error
> messages and if any was created I will sent it via an other
> orchestration to a MSMQ. An administrator will get some tool to watch
> all errors and he would be able to react on such a failure.
>
> But unfortunately BTS doesn't create such an error message. Why not? In
> the internet you find many resources that describe this behaiviour. Any
> ideas? If not I have to change my solution so I want to be sure that I
> didn't miss some important point.
>
>
> Thanks!
> Alex
>



Alex

2006-06-26, 7:25 am

Hello Greg,

thank you for your answer! It clarified many points for me. Probably I
will implement a custom validation component.

Thanks!
Alex

Greg Forsythe wrote:[vbcol=seagreen]
> The map just performs a transformation. XSLT 1.0 is not schema aware so does
> not know whether the input or output documents are valid.
> When using the VS.NET Test Map function a XML Schema validation is
> explicitly performed on the input and output document, this does not happen
> at runtime.
>
> You need to explicitly add a Validation Step.
> You could validate once on input, but this could prove tricky as the
> minOccurs attribute of some fields differs.
> Alternatively you could validate on output.
> You cannot use the standard XML Validator pipeline component as this
> requires the schemas to be loaded in Biztalk.
> You will need to create your own custom validation step in the orchestration
> after the map. Either using a custom C# library to perform Xml Schema
> validation or use another map(custom XSLT) to implement a Schematron type
> validation.
>
> Greg
>
> "Alex" <alex_doehling@web.de> wrote in message
> news:1150984596.171107.246260@r2g2000cwb.googlegroups.com...

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com