BizTalk Server - Iterate through message nodes from .NET component

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server > April 2005 > Iterate through message nodes from .NET component





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 Iterate through message nodes from .NET component
Madani Benghia

2005-03-29, 7:49 am

Hello,

I am receiving an xml message from a File Receive Port and then passing it
to my .NET component in the expression shape.My message will have hundreds
of records ,and I want to iterate through them from my .NET component.

My question is : what is the best way of doing that and do i need to promote
the nodes ?


Thank you in advance.

Madani Benghia


Yossi Dahan

2005-03-29, 7:49 am

You will actually not be able to promote the nodes, as you can not promote
elements that occur more the once in the document.
There are a few posts on the subject.
you could either pass the entire message to .net component as an XmlDocument
and let it run the logic or use xpath to iterate on the nodes in an
orchestration

Yossi Dahan


"Madani Benghia" <madani@hotmail.com> wrote in message
news:uydZJ$DNFHA.164@TK2MSFTNGP12.phx.gbl...
> Hello,
>
> I am receiving an xml message from a File Receive Port and then passing it
> to my .NET component in the expression shape.My message will have hundreds
> of records ,and I want to iterate through them from my .NET component.
>
> My question is : what is the best way of doing that and do i need to
> promote
> the nodes ?
>
>
> Thank you in advance.
>
> Madani Benghia
>
>



Adam

2005-03-29, 6:18 pm

Madani,
I have found that the best way to iterate through an XML is with the
XmlTextReader. This is assuming you need only read the document and act
on the idividual nodes as you go. You don't get the ability to navigate
or manipulate the DOM as you get in the XMLDocument class, but it's
lighter and much faster. Also keep in mind that Biztalk can iterate
through your document using XPath, and you can promote attributes for
content based routing or checking with the rules engine. BizTalk in
that case handles all the multi threading for you... Hope this helps.

http://msdn.microsoft.com/library/d...rclasstopic.asp

Stephen W. Thomas

2005-03-29, 6:18 pm

Hello.

I have some samples listed below that show XmlTextReader and NodeLists in
..net.
http://www.geekswithblogs.net/sthom...3/21/26924.aspx (using
XmlTextReader)
http://www.geekswithblogs.net/sthom...2/12/17373.aspx (xpath
and node list)

Hope this helps.

Stephen W. Thomas
http://www.geekswithblogs.net/sthomas


"Madani Benghia" wrote:

> Hello,
>
> I am receiving an xml message from a File Receive Port and then passing it
> to my .NET component in the expression shape.My message will have hundreds
> of records ,and I want to iterate through them from my .NET component.
>
> My question is : what is the best way of doing that and do i need to promote
> the nodes ?
>
>
> Thank you in advance.
>
> Madani Benghia
>
>
>

dalegaspi

2005-04-01, 5:54 pm

the message can be assigned to a System.Xml.XmlDocument variable--i.e.,
if you have a XmlDocument Variable named xmldoc, you can simply assign
the message to the variable:

xmldoc = My_message_var;

My_dot_net_class.my_method(xmldoc);

dexter

Madani Benghia wrote:
> Hello,
>
> I am receiving an xml message from a File Receive Port and then

passing it
> to my .NET component in the expression shape.My message will have

hundreds
> of records ,and I want to iterate through them from my .NET

component.
>
> My question is : what is the best way of doing that and do i need to

promote
> the nodes ?
>
>
> Thank you in advance.
>
> Madani Benghia


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com