BizTalk Server General - How to enrich a message?

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > May 2006 > How to enrich a message?





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 How to enrich a message?
Obiwan Jacobi

2006-05-30, 7:15 am

Hi,

I'm a BizTalk newbee and I am trying to enrich a message. Most of the
fields can be copied direcly and a database lookup should provide the
rest of the information. The information that is to be added to the
destination message is complex; a hierarchy with multiple repeating
elements.

I've tried to use a Map and a Database Lookup functoid. But this only
works well for single field (one row at best) enrichment. Then I tried
to use the scripting functoid to call an external assembly that looks
up the extra information. But there was no way I got the extra
information to be copied into the destination schema. I've tried
returning a custom Xml serializable class, an XmlDocument, an XmlNode
and a string containing the xml. Either the new element was not added
at all or I got an error the element could not contain text (as defined
in the destiniation schema).

I also tried to pass the output of the scripting functoid that calls
the external assembly into another scripting functoid that contained an
xslt call template. But I didn't know how to copy the XmlDocument in
the <xsl:param> out to the destination. I've tried <xsl:copy-of
select="document($param1)"/> but that didn't work.

So if anyone has any idea how to get an xml fragment into the
destination schema. I would be very gratefull.

Thanx
Marc Jacobi

Dick Dijkstra

2006-05-30, 7:15 am

Marc,

I would go for an orchestration that calls an external assembly that
does the transformation instead of using the mapper.

HTH,

Dick Dijkstra

Greg Forsythe

2006-05-30, 7:15 am

If you wish to insert Xml into the destination that did not originate in the
source you need to use <xsl:value-of> and a string representation of the Xml

A scripting functoid like
public string GetXml(XmlDocument doc)
{
return doc.OuterXml;
}

then use an inline XSLT
<xsl:value-of disable-output-escaping="yes"
select="userCSharp:GetXml(yourXmldoc"/>

Greg

"Obiwan Jacobi" <obiwanjacobi@hotmail.com> wrote in message
news:1148980070.728191.41800@i40g2000cwc.googlegroups.com...
> Hi,
>
> I'm a BizTalk newbee and I am trying to enrich a message. Most of the
> fields can be copied direcly and a database lookup should provide the
> rest of the information. The information that is to be added to the
> destination message is complex; a hierarchy with multiple repeating
> elements.
>
> I've tried to use a Map and a Database Lookup functoid. But this only
> works well for single field (one row at best) enrichment. Then I tried
> to use the scripting functoid to call an external assembly that looks
> up the extra information. But there was no way I got the extra
> information to be copied into the destination schema. I've tried
> returning a custom Xml serializable class, an XmlDocument, an XmlNode
> and a string containing the xml. Either the new element was not added
> at all or I got an error the element could not contain text (as defined
> in the destiniation schema).
>
> I also tried to pass the output of the scripting functoid that calls
> the external assembly into another scripting functoid that contained an
> xslt call template. But I didn't know how to copy the XmlDocument in
> the <xsl:param> out to the destination. I've tried <xsl:copy-of
> select="document($param1)"/> but that didn't work.
>
> So if anyone has any idea how to get an xml fragment into the
> destination schema. I would be very gratefull.
>
> Thanx
> Marc Jacobi
>



Obiwan Jacobi

2006-05-30, 1:14 pm

Thanx Dick and Greg.

I followed Greg's suggestion in the solution that I discovered in the
mean time. Here's my blog post:
http://bloggingabout.net/blogs/marc...5/30/12265.aspx

I'm wondering, Dick. Why would an orchestraion be a better (or easier?)
solution? Would you suggest that a custom method takes care of the
complete mapping or just the lookup part? I personally think a map is a
cleaner solution (although the functoid mess inside could use some work
;-). And a map is cheaper to execute than an orchestration and can be
used in different places (ports and orchestrations).

Dick Dijkstra

2006-05-31, 7:15 am

Hi Marc,

I agree that a map is a cleaner solution, but in my opinion maps
shouldn't be too complicated. Actually, I only use maps for structure
transformations and simple conversion. However, complexity is
relative... I would use a custom method for the complete
transformation.

Dick Dijkstra


Obiwan Jacobi wrote:
> Thanx Dick and Greg.
>
> I followed Greg's suggestion in the solution that I discovered in the
> mean time. Here's my blog post:
> http://bloggingabout.net/blogs/marc...5/30/12265.aspx
>
> I'm wondering, Dick. Why would an orchestraion be a better (or easier?)
> solution? Would you suggest that a custom method takes care of the
> complete mapping or just the lookup part? I personally think a map is a
> cleaner solution (although the functoid mess inside could use some work
> ;-). And a map is cheaper to execute than an orchestration and can be
> used in different places (ports and orchestrations).


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com