|
Home > Archive > BizTalk Server Tools > July 2005 > Mapping Question - Tracking erroneous data type
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 Question - Tracking erroneous data type
|
|
|
| Hi,
I am using biztalk mapper to map i/p xml to o/p. A particular element in
both i/p & o/p schema is defined as numeric - However, when I pass the wrong
value (e.g. string) to this element, the mapping still works and the o/p is
created with that string value.
The incoming XML has DTD attached to it (with the interested element defined
as PCDATA) - However, no error is detected.
How do I detect the error?
Thanks,
Ken
| |
| David Carroll 2005-07-19, 5:51 pm |
| Ken,
You will need to create a custom Pipeline (either receive or
send-depending on your use) and drop the provided XML Validator
component into the Validate Stage (for Receive Pipelines) or Encode
Stage (for Send Pipeline). Compile your BizTalk Project and deploy.
Reconfigure either your receive location or send port to point to the
validating pipeline. Don't forget to restart your BizTalk Service.
Retry your test.
Schema validation will typically take place in custom receive and send
pipelines and must be explicitly requested. The out-of-the-box
pipelines XMLReceive, XMLTransmit, PassThruReceive, PassThruTransmit
will not fully validate the body of the message against a schema.
XMLReceive and XMLTransmit will validate schema namespace only and
extract promoted properties for custom message routing. PassThru
Pipelines will simply move messages in and out of the Message Box
without any validation. In fact, the message doesn't even have to be
XML for PassThru Pipelines. Maps expect the format of the XML Message
to match that of the declared schema in the XML Message. For
Orchestrations, you could implement custom XML Validation using an
XMLValidationReader in a helper static class which would be called from
an expression shape.
Ultimately, BizTalk is not concerned with the message anymore than it
needs to be for performance reasons. If you've defined promoted
properties, the messaging engine will extract those properties from the
XML. Orchestration Services will extract values defined as
distinguished fields. If the xpaths to promoted properties or
distinguished fields are invalid, BizTalk will throw an exception. The
XML contained in the message is expected to be valid according to the
declared namespace. This expectation can be controlled by publishing
the schema to trading partners or by placing good controls on message
transformations.
Often times, validation is redundant and will only be required when
receiving a message. Once the message is within your trusted domain,
you can simply move the message without the overhead of validation.
I hope this helps.
David Carroll
Ken wrote:
> Hi,
>
> I am using biztalk mapper to map i/p xml to o/p. A particular element in
> both i/p & o/p schema is defined as numeric - However, when I pass the wrong
> value (e.g. string) to this element, the mapping still works and the o/p is
> created with that string value.
>
> The incoming XML has DTD attached to it (with the interested element defined
> as PCDATA) - However, no error is detected.
>
> How do I detect the error?
>
> Thanks,
> Ken
|
|
|
|
|