|
Home > Archive > BizTalk Server Orchestration > December 2004 > Messages contructing in catch exception
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 |
Messages contructing in catch exception
|
|
| Marco Ganio Vecchiolino 2004-12-10, 7:47 am |
| Hi all,
I hope someone help me, i'm a newbuy to BizTalk 2k4, and i've been stoned
against at least one problem for each "baby step" of my BT Experience.
Since now, none have helped me.
This time i can't see a solution. I have an Orchestration that receive an
XML message via HTTPReceive. Then some business roules are applied on. The
rule i'm implementing now is applied within a "scope" (that is: a
try..catch), by the grace of a .Net class already developed in previous
project.
This class throw a custom exception if rule is violed, so there is a Catch
Shaper in the Scope.
Within this Catch shape i have placed a Contrusct Message Shape. I wont send
a message completely new, not derived from ingoing one by a transformation.
Obiouvsly, some values are copied in new message thanks to an Message
Assignment Shape within the Construct Message Shape. In the Expression of
such an Assignment Shape, i've tried to executed some assignment in this wasy:
newMessage("field1") = CurrentMessage.OrderID; //just a sample
newMessage("field2") = 50; //i never found a functoid to introducing
//costants in messages
Well: compiler say "Use of uncostructed message" but: hey! I've used a
Message Construction Shape. I understood that such a Shape initialize new
messages, exactly one message of the type which the Shape is bounded to...
So I ask for your help: is there a wrong-way-of-use in my flow? How can i
acheve what i'm seeking?
I only hope you will help me.
Kind regards,
Marco G.V.
--
Marco Ganio Vecchiolino
| |
| Matt Meleski 2004-12-10, 7:47 am |
| Marco,
So in your contruct statement , you have something like :
newMessage("field1") = CurrentMessage.OrderID;
newMessage("field2") = 50;
and that is all ?
If this is so then field1 and field2 nodes do not yet exist in your
message.
Therefore alter your statement to look something like this :
(Create a XMLDom variable in your orchestration and load it with some XML
that
represents your message.)
varXMLDom.LoadXml(@"<ns0:MyMessage field1="Some value" field2="Some value"
xmlns:ns0=http://mymessages.amessage />");
// Then you could assign your values using xpath or distinguished fields.
There are a number of ways to construct messages in an orchestration,
below describes some of the ways :
http://objectsharp.com/Blogs/matt/a...11/09/1009.aspx
Matt
"Marco Ganio Vecchiolino" wrote:
> Hi all,
>
> I hope someone help me, i'm a newbuy to BizTalk 2k4, and i've been stoned
> against at least one problem for each "baby step" of my BT Experience.
> Since now, none have helped me.
>
> This time i can't see a solution. I have an Orchestration that receive an
> XML message via HTTPReceive. Then some business roules are applied on. The
> rule i'm implementing now is applied within a "scope" (that is: a
> try..catch), by the grace of a .Net class already developed in previous
> project.
> This class throw a custom exception if rule is violed, so there is a Catch
> Shaper in the Scope.
>
> Within this Catch shape i have placed a Contrusct Message Shape. I wont send
> a message completely new, not derived from ingoing one by a transformation.
> Obiouvsly, some values are copied in new message thanks to an Message
> Assignment Shape within the Construct Message Shape. In the Expression of
> such an Assignment Shape, i've tried to executed some assignment in this wasy:
> newMessage("field1") = CurrentMessage.OrderID; //just a sample
> newMessage("field2") = 50; //i never found a functoid to introducing
> //costants in messages
>
> Well: compiler say "Use of uncostructed message" but: hey! I've used a
> Message Construction Shape. I understood that such a Shape initialize new
> messages, exactly one message of the type which the Shape is bounded to...
>
> So I ask for your help: is there a wrong-way-of-use in my flow? How can i
> acheve what i'm seeking?
>
> I only hope you will help me.
>
> Kind regards,
>
> Marco G.V.
>
> --
> Marco Ganio Vecchiolino
| |
| Marco Ganio Vecchiolino 2004-12-10, 5:50 pm |
| Thank you Matt,
your post is a light in the doom here 
I've read your article (that was not trapped by Google when i search
for...), and it seems to be good enought.
Thanks to your graceful help, now I can plan to make a little work on my
orch. to achieve the modeling goal; and in a second time using what you call
"a more complex message" to aggregate results of business roules (clearly by
copying and destroy old message).
That complex result should be combined with configuring dynamic values and
them all filtered by a smart-xsl giving the final result for the request.
Since I won't hardcode XML instances, i perform a transformation *before*
the assignment: that should give enought information to construct message.
Instead, "use of uninitialized message" is still hounting me (even if both
operations run in same construct shape, and all mentioned field are
distinguished).
Now I go with your article: hard-coding XML instance-template in order to
actualize values in second time.
Many, many thanks!
Marco
|
|
|
|
|