1. Problem
Before receiving an XML message, you would like to transform a message into a predetermined XML format.
2. Solution
Within BizTalk, you can map
source messages into a destination format. You can map with a receive
port, an orchestration, or send port. Here, we will outline the steps
for mapping in a receive port.
Open a receive port that you wish to configure a map on.
NOTE
Remember that when setting a map on a receive port, it will apply to all receive location associated with that port.
Click the Inbound Maps tab.
In
the grid that opens, select a deployed map.It will automatically fill
in the source and target schemas, based on the map.A receive port can
have multiple maps associated with it.See Figure 1.
3. How It Works
This recipe's solution
described how to configure a receive port to perform inbound mapping
transformation. Remember that when you're using a receive port, the
inbound message must be in an XML format. If inbound mapping is
configured, the message must also conform to the schema of that
specified in the inbound format of the map in question. If the message
does not match, the message will fail in the map, and the message
interchange will be marked for exception processing.
Another key concept to keep
in mind when configuring receive port maps is that more than one map can
be specified on a receive port. Multiple XML schemas can be accepted by
the receive port; it is not tied to one specific schema. For example,
if you have three purchase order document formats arriving from external
entities, you could transform each format to a common (canonical)
format via port maps on the receive port. This process is commonly
referred to as document normalization.
In this instance, you could have three maps to support each format and a
single receive port to satisfy the solution. This scenario is
demonstrated in Figure 2.
A key consideration
when applying receive port maps is how you plan to handle exceptions,
such as an XML message that does not conform to a map, invalid XML
received, and data enrichment required during or before transformation.
All of these exceptions could be handled within a port map or receive
location, or with downstream BizTalk orchestration functionality.