Constructing a message in the Message Assignment Shape
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 Orchestration > Constructing a message in the Message Assignment Shape




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

    Constructing a message in the Message Assignment Shape  
Christoffer


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


 
08-12-04 07:46 AM

Hello,

I'm about to construct a message using the Message Assignment Shape in my
Orchestration. Now, I found out in the BizTalk documentation
(http://msdn.microsoft.com/library/d...n-us/sdk/htm/eb
iz_prog_orch_guxr.asp) that the syntax for creating a message is:

MsgOut = CreateMsgHelper.Helper.GetXmlDocumentTemplate();

My message is a "SupplierAnswer" so I replaced the "MsgOut" with
"SupplierAnswer", that is:

SupplierAnswer = CreateMsgHelper.Helper.GetXmlDocumentTemplate();

But got the error "identifier CreateMsgHelper does not exist in...", so I
had a look at the Internet and found this piece of code:

InvoiceMsg = InvoiceMsgConstructor.Helper.GetXmlDocumentTemplate();

So I replaced "InvoiceMsg" with "SupplierAnswer", that is:

SupplierAnswer = SupplierAnswerConstructor.Helper.GetXmlDocumentTemplate();

But got the error "identifier SupplierAnswerConstructor does not exist
in...".

Could any please tell me what the syntax is for constructing the
SupplierAnswer message?

Thanks for any help,
Chris







[ Post a follow-up to this message ]



    Re: Constructing a message in the Message Assignment Shape  
Treudler


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


 
08-12-04 12:49 PM

1. You must create an Assembly that contain (from your url):

private static XmlDocument _template = null;
private static object _sync = new object();
private static String LOCATION = @"C:\MyTemplateLocation\MyMsgTemplate.xml";

public static XmlDocument GetXmlDocumentTemplate()
{
XmlDocument doc = _template;
if (doc == null)
{
// Load the doc template from disk.
doc = new XmlDocument();
XmlTextReader reader = new XmlTextReader(LOCATION);
doc.Load(reader);

// Synchronize assignment to _template.
lock (_sync)
{
XmlDocument doc2 = _template;
if (doc2 == null)
{
_template = doc;
}
else
{
// Another thread beat us to it.
doc = doc2;
}
}
}

// Need to explicitly create a clone so that we are not
// referencing the same object statically held by this class.
doc = (XmlDocument) doc.CloneNode(true);
return doc;
}
2. in your Biz-project add the assembly to your references3. add the
assembly to GAC (gacuil /i /f filname)This sample create message from the
file C:\MyTemplateLocation\MyMsgTemplate.xml, do you want to have
this?Christian"Christoffer" <christoffer@nospam.com> wrote in message
news:O1dLDREgEHA.3416@TK2MSFTNGP09.phx.gbl...
> Hello,
>
> I'm about to construct a message using the Message Assignment Shape in my
> Orchestration. Now, I found out in the BizTalk documentation
>
(http://msdn.microsoft.com/library/d...n-us/sdk/htm/eb
> iz_prog_orch_guxr.asp) that the syntax for creating a message is:
>
> MsgOut = CreateMsgHelper.Helper.GetXmlDocumentTemplate();
>
> My message is a "SupplierAnswer" so I replaced the "MsgOut" with
> "SupplierAnswer", that is:
>
> SupplierAnswer = CreateMsgHelper.Helper.GetXmlDocumentTemplate();
>
> But got the error "identifier CreateMsgHelper does not exist in...", so I
> had a look at the Internet and found this piece of code:
>
> InvoiceMsg = InvoiceMsgConstructor.Helper.GetXmlDocumentTemplate();
>
> So I replaced "InvoiceMsg" with "SupplierAnswer", that is:
>
> SupplierAnswer =
SupplierAnswerConstructor.Helper. GetXmlDocumentTemplate();
>
> But got the error "identifier SupplierAnswerConstructor does not exist
> in...".
>
> Could any please tell me what the syntax is for constructing the
> SupplierAnswer message?
>
> Thanks for any help,
> Chris
>
>







[ Post a follow-up to this message ]



    Re: Constructing a message in the Message Assignment Shape  
Alan Smith


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


 
08-12-04 12:49 PM

Hi Chris,

There's a quick way to get this working. In the message assignemnt shape use
this code. (You will need to add msgXmlDoc as a XmlDocument orhestration
variable).

msgXmlDoc = new XmlDocument ();
msgXmlDoc.LoadXml (@" --  insert template XML for message here -- ");

msgGenerated = msgXmlDoc;

This means that you don't need to fool around with another
project/assembly/GAC registration
but you have to have the message template string hard-coded in the
orchestration (ungood).

Cheers,

Alan

----
BizTalk & .net
Consulting Training Mentoring
Stockholm London Europe
See aboutme for contact info



"Treudler" wrote:

> 1. You must create an Assembly that contain (from your url):
>
> private static XmlDocument _template = null;
> private static object _sync = new object();
> private static String LOCATION = @"C:\MyTemplateLocation\MyMsgTemplate.xml
";
>
> public static XmlDocument GetXmlDocumentTemplate()
> {
>    XmlDocument doc = _template;
>    if (doc == null)
>    {
>       // Load the doc template from disk.
>       doc = new XmlDocument();
>       XmlTextReader reader = new XmlTextReader(LOCATION);
>       doc.Load(reader);
>
>       // Synchronize assignment to _template.
>       lock (_sync)
>       {
>          XmlDocument doc2 = _template;
>          if (doc2 == null)
>          {
>             _template = doc;
>          }
>          else
>          {
>             // Another thread beat us to it.
>             doc = doc2;
>          }
>       }
>    }
>
>    // Need to explicitly create a clone so that we are not
>    // referencing the same object statically held by this class.
>    doc = (XmlDocument) doc.CloneNode(true);
>    return doc;
> }
> 2. in your Biz-project add the assembly to your references3. add the
> assembly to GAC (gacuil /i /f filname)This sample create message from the
> file C:\MyTemplateLocation\MyMsgTemplate.xml, do you want to have
> this?Christian"Christoffer" <christoffer@nospam.com> wrote in message
> news:O1dLDREgEHA.3416@TK2MSFTNGP09.phx.gbl... 
> ([url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdk/htm/eb[/ur
l] 
> SupplierAnswerConstructor.Helper.GetXmlDocumentTemplate(); 
>
>
>





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:35 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