|
Home > Archive > BizTalk Server Orchestration > June 2004 > How to initialize 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 initialize a message?
|
|
| Frank Schumacher 2004-06-26, 10:53 am |
| Hi NG,
I thought it is a simple thing to create a message within biztalk and
send it through a sendport, but I was wrong.
I have a simple xsd and create a Message from this xsd.
All 4 fields are distinguished, because I want to set them manually.
Now I use a "Create Message" Shape to instanciate (so I thought) the
message. Within this shape, I want to assign the (constant) values to
the fields of my message. Doing this, BizTalk tells me, that I try to
use a message, that isn't initialized.
So I used a dirty workaround. I simply mapped a field of an existing
message to all the fields in my new message and put a Transform-Shape in
the Create Message-Shape, just preliminary to my Assign-Shape.
And THIS worked. It seems, that the transform shape is doing something
with the message, that the assign shape doesn't.
So, how can I create a new message, without using this workaround?
Thanks in advance,
Frank
| |
| Frank Schumacher 2004-06-26, 10:53 am |
| It's me again,
I found out, that I can instanciate a new message from an existing on e
in my assign shape like:
MyNewMessage = ExistingMessage;
if they have the same messagetype. But what do I do, if I have no
existing message yet?
Thanks in advance,
Frank
Frank Schumacher wrote:
> Hi NG,
>
> I thought it is a simple thing to create a message within biztalk and
> send it through a sendport, but I was wrong.
>
> I have a simple xsd and create a Message from this xsd.
> All 4 fields are distinguished, because I want to set them manually.
>
> Now I use a "Create Message" Shape to instanciate (so I thought) the
> message. Within this shape, I want to assign the (constant) values to
> the fields of my message. Doing this, BizTalk tells me, that I try to
> use a message, that isn't initialized.
>
> So I used a dirty workaround. I simply mapped a field of an existing
> message to all the fields in my new message and put a Transform-Shape in
> the Create Message-Shape, just preliminary to my Assign-Shape.
> And THIS worked. It seems, that the transform shape is doing something
> with the message, that the assign shape doesn't.
>
> So, how can I create a new message, without using this workaround?
>
> Thanks in advance,
> Frank
| |
| Iuliu Rus 2004-06-26, 10:53 am |
| You should be able to assign an XMLDocument to a message. Try this:
- add a variable of the type XmlDocument to your orchestration
- in message assignment, initialize the XmlDocument : document.LoadXml("<my
xml here/>") or document.Load("my file path");
- construct your message from the xml document: myMessage = document;
You can also call a .net class that returns a xml message: myMessage =
MyClass.MyStaticMethodThatReturnsXmlDocument();
| |
| Frank Schumacher 2004-06-26, 10:53 am |
| Thanks Iuliu,
although I don't understand why BizTalk can't create the file itself. I
will try your solution soon.
Ciao,
Frank
Iuliu Rus wrote:
> You should be able to assign an XMLDocument to a message. Try this:
> - add a variable of the type XmlDocument to your orchestration
> - in message assignment, initialize the XmlDocument : document.LoadXml("<my
> xml here/>") or document.Load("my file path");
> - construct your message from the xml document: myMessage = document;
>
> You can also call a .net class that returns a xml message: myMessage =
> MyClass.MyStaticMethodThatReturnsXmlDocument();
>
|
|
|
|
|