How to enrich a message?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server General > How to enrich a message?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    How to enrich a message?  
Obiwan Jacobi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-30-06 12:15 PM

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






[ Post a follow-up to this message ]



    Re: How to enrich a message?  
Dick Dijkstra


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-30-06 12:15 PM

Marc,

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

HTH,

Dick Dijkstra






[ Post a follow-up to this message ]



    Re: How to enrich a message?  
Greg Forsythe


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-30-06 12:15 PM

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
>







[ Post a follow-up to this message ]



    Re: How to enrich a message?  
Obiwan Jacobi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-30-06 06: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).






[ Post a follow-up to this message ]



    Re: How to enrich a message?  
Dick Dijkstra


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-31-06 12:15 PM

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).






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:32 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register