There are several application systems that pass messages to each other as part of their work process. Due to technical constraints revolving transactional integrity, the application data and message delivery are all committed into a single mainframe DB2 database. The messages are not directly passed to BizTalk server (2006 R2); it is up to BTS to pull the message out from the DB2 database later.
The message-queue table in the DB2 database has several fields. The key field is the MESSAGE_DATA column - the actual message; it is XML content itself. When one uses the DB2 adapter to query out records from the table the incoming schema would be like
CORRECTION UPDATE: the DB2Message schema is attribute based; I mistook it previously to be element based.
<DB2Message MESSAGE_DATA="<InternalXML> ........ </InternalXML>"
MESSAGE_DATE="2008-1-1 00:00:00" MESSAGE_ID="GUID" TXN_ID="GUID" .... other attrib />
The orchestration consumes the schema
<EAIMessage>
<Header>
<ServiceID>
<MessageID>
....
<Mode>
</Header>
<Body>
<RawXML>
</Body>
</EAIMessage>
The orchestration will use several promoted fields in the Header to make routing and processing decisions. The thing is, those header fields are actually coming from the inner-XML content stored into DB2Message's MESSAGE_DATA.
At this single level, the Mapper has no knowledge of this underyling XML schema inside MESSAGE_DATA when pitting the two schemas together. There should probably be some XPath functoid that can further drill down the MESSAGET_DATA element to conduct the proper mapping of values, but having not dealt with extensive XML and XSLT applications before, I am unable to see the features available that can help me perform this task.
Has anybody done such data extraction and mapping before?
UPDATE. As requested, in the MESSAGE_DATA inner XML may look like
<Message>
<Id>e86970f4-0455-4535-8e65-a06eb7aaef8a</Id>
<SenderApp>999</SenderApp>
<ReceiverApp>2000</ReceiverApp>
<ServiceId>8798973454</ServiceId>
<Mode>P</Mode>
<MuxId></MuxId>
<ExceptionCode></ExceptionCode>
<ExceptionMessage></ExceptionMessage>
<Body>
<WorkItem xmlns="http://tempuri.org/WorkItem.xsd">
<ServiceHeader xmlns="http://tempuri.org/Service.xsd">
<ID_UPDATED_BY>username</ID_UPDATED_BY>
<ID_HISTORY_REF>xxxxxxx</ID_HISTORY_REF>
<SESSION_ID>sessionID</SESSION_ID>
<DT_LAST_UPDATE>timestamp</DT_LAST_UPDATE>
<TM_LAST_UPDATE>time</TM_LAST_UPDATE>
</ServiceHeader>
</WorkItem>
</Body>
</Message>