Properties are not promoted after debatching/envelope processing

I recently stumbled into a problem with property promotion. I used the DB2 adapter to get multiple records from a table, and then used envelope processing to split the message into several with one record per message. An example envelope looked like this:
 
<PurchaseOrderHeaderEnvelope_LCD xmlns="urn:Coop.THA.PurchaseOrders">
  <T_EX_ORDER_HUV LC_ID="505" DEPA_ID="1" EX_ORDER_NR="800000" … />
  <T_EX_ORDER_HUV LC_ID="505" DEPA_ID="1" EX_ORDER_NR="800001" … />
  <T_EX_ORDER_HUV LC_ID="505" DEPA_ID="1" EX_ORDER_NR="800002" … />
</PurchaseOrderHeaderEnvelope_LCD>
 
And after split, there were three messages like this:
 
<T_EX_ORDER_HUV LC_ID="505" DEPA_ID="1" EX_ORDER_NR="800000" … />
I had promoted some attributes in this schema, e.g. LC_ID, but the problem was that they were never promoted to the incoming message. After searching the web for a while, I found others had this problem too. It seems to be a bug in the XML disassembler component. There were three suggested solutions:
 
1. Install a hotfix described in http://support.microsoft.com/kb/927741. That would not install on my system – maybe because I’m using BizTalk 2006 R2, and the hotfix was for BizTalk 2006?
 
2. Change the message structure to use start and end tags. In my case:
 
<PurchaseOrderHeaderEnvelope_LCD xmlns="urn:Coop.THA.PurchaseOrders">
  <T_EX_ORDER_HUV LC_ID="505" DEPA_ID="1" EX_ORDER_NR="800000" … ></T_EX_ORDER_HUV>
  <T_EX_ORDER_HUV LC_ID="505" DEPA_ID="1" EX_ORDER_NR="800001" … ></T_EX_ORDER_HUV>
  <T_EX_ORDER_HUV LC_ID="505" DEPA_ID="1" EX_ORDER_NR="800002" … ></T_EX_ORDER_HUV>
</PurchaseOrderHeaderEnvelope_LCD>
 
I could not do that, because the message is generated by the DB2 adapter.
 
3. If using the SQL adapter, you can the ELEMENTS option in the FOR XML clause. You will get the columns as elements rather than as attributes. Again, I was using the DB2 adapter, so I could not do that.
 
I thought for a while and came up with an idea. Since you can have a map in the receive port, properties in the destination schema must be promoted after the mapping. I tried to create a dummy mapping with the document schema as both source and target and use that in the receive port. It worked!
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s