BizTalk Server General - BizTalk 2004 :: messages mutating when they shouldnt be

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > April 2006 > BizTalk 2004 :: messages mutating when they shouldnt be





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 BizTalk 2004 :: messages mutating when they shouldnt be
BA

2006-04-27, 7:26 am


Hello all,

I have a BAZZAR one:

I have a message coming into an orchestration (M1) which is copied to a new
message name (M2) and then is passed to a C# component where it is being
modified and returned back to the orchestration.

For some reason I cant understand the messages are all being mutated once
the component is callled. M1 should never be modified but it equals the
value of M2 once the component is called. This is very frustrating since
I need the unmodified M1 later in the orchestration. Even if I set M1 =
M3 for example, M3 is ALSO mutated to the value of M2 !!!!!

I have tried 100 different message combination and nothing changes this behavior.

The component is called in a message assignment shape like this:

......
M2 = M1
M2 = Stater.Isvcs.Iface.MO.OFKA.Reporting.Support.addEnrich.ReturnOkResponse(M2);

//Check the value of M1
xDoc = M1;
System.Diagnostics.Debug.WriteLine("M1 = " + xDoc.OuterXml);
.....

Even if I set M1 to an xml doc variable and then set M2 to that variable
its being mutated.

Help !!

BA
http://biztalkia.blogspot.com/



Jan Eliasen

2006-04-27, 7:26 am

On Wed, 26 Apr 2006 11:53:46 +0000 (UTC), BA
<biztalk.architect@gmail.com> wrote:

>Even if I set M1 to an xml doc variable and then set M2 to that variable
>its being mutated.

It is all related to how objectoriented languages work. As long as you
are only changing the pointers, you are not actually creating a new
object. Try this:

xmldocVariable1 = M1;
xmldocVariable2 = new System.Xml.XmlDocument();
xmldocVariable2.loadXml(xmldocVariable1.OuterXml);
M2 = M1;
M1 = xmldocVariable2;
M2 =
Stater.Isvcs.Iface.MO.OFKA.Reporting.Support.addEnrich.ReturnOkResponse(M2);

--
Eliasen Jr. representing himself and not the company he works for.

Private email: jan@eliasen.dk

"Ford," he said, "you're turning into a penguin. Stop it."
BA

2006-04-27, 1:21 pm

Thanks for the reply, Jan.

Makes a bit more sense although I wonder why there is so much information
about the immutability of messages.

BA

> On Wed, 26 Apr 2006 11:53:46 +0000 (UTC), BA
> <biztalk.architect@gmail.com> wrote:
> It is all related to how objectoriented languages work. As long as you
> are only changing the pointers, you are not actually creating a new
> object. Try this:
>
> xmldocVariable1 = M1;
> xmldocVariable2 = new System.Xml.XmlDocument();
> xmldocVariable2.loadXml(xmldocVariable1.OuterXml);
> M2 = M1;
> M1 = xmldocVariable2;
> M2 =
> Stater.Isvcs.Iface.MO.OFKA.Reporting.Support.addEnrich.ReturnOkRespons
> e(M2);
> Private email: jan@eliasen.dk
>
> "Ford," he said, "you're turning into a penguin. Stop it."
>



Jan Eliasen

2006-04-28, 7:16 am

On Thu, 27 Apr 2006 14:32:57 +0000 (UTC), BA
<biztalk.architect@gmail.com> wrote:

>Thanks for the reply, Jan.

No problem

>Makes a bit more sense although I wonder why there is so much information
>about the immutability of messages.

True - a bit weird since they can actually be changed a number of
places...

--
Eliasen Jr. representing himself and not the company he works for.

Private email: jan@eliasen.dk

"Ford," he said, "you're turning into a penguin. Stop it."
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com