Message Assignment - Can Schema Be Used vs Hardcoding?
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 > Message Assignment - Can Schema Be Used vs Hardcoding?




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

    Message Assignment - Can Schema Be Used vs Hardcoding?  
CranCran77


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


 
02-05-06 10:06 PM

I have an orchestration that performs an insert into TableA and
multiple child records into TableB.  What I have to do is make an
initial call to my database to get a sequence id that I use to uniquely
identify the relationship between TableA's record and TableB's records.

I have defined a variable in my Orchestration called "varXmlDocument"
that is of System.Xml.XmlDocument.  In a message assignment shape, I do
the following:

varXmlDocument = new System.Xml.XmlDocument();
varXmlDocument.LoadXml(@"<ns0:GetSeqA
xmlns:ns0=""http://Project/GetSeqA""/>");
HeaderSeqMessage = varXmlDocument;

Is there a way to assign the XML to the XmlDocument variable without
actually having to "hard-code" the xml document?  Would it be possible
to utilize the schema in the project to do this as so if the schema
changes, this shape does not formulate an invalid XML document?






[ Post a follow-up to this message ]



    Re: Message Assignment - Can Schema Be Used vs Hardcoding?  
Tomas Restrepo \(MVP\)


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


 
02-05-06 10:06 PM

CranCran,

>I have an orchestration that performs an insert into TableA and
> multiple child records into TableB.  What I have to do is make an
> initial call to my database to get a sequence id that I use to uniquely
> identify the relationship between TableA's record and TableB's records.
>
> I have defined a variable in my Orchestration called "varXmlDocument"
> that is of System.Xml.XmlDocument.  In a message assignment shape, I do
> the following:
>
> varXmlDocument = new System.Xml.XmlDocument();
> varXmlDocument.LoadXml(@"<ns0:GetSeqA
> xmlns:ns0=""http://Project/GetSeqA""/>");
> HeaderSeqMessage = varXmlDocument;
>
> Is there a way to assign the XML to the XmlDocument variable without
> actually having to "hard-code" the xml document?  Would it be possible
> to utilize the schema in the project to do this as so if the schema
> changes, this shape does not formulate an invalid XML document?

Unfortunately, no, you can't really use the schema itself to generate it, in
general terms (it would be possible for very basic schemas, but difficult to
generalize completely).

What you can do is move your XML out of a string literal in your
orchestration. Scott Colestock shows a very nice way of doing it with
embedded resources in a utility .NET Assembly, which makes it far easier to
manipulate and maintain:

http://www.traceofthought.net/Perma...d4.
aspx



--
Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/







[ Post a follow-up to this message ]



    Re: Message Assignment - Can Schema Be Used vs Hardcoding?  
CranCran77


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


 
02-06-06 01:46 AM

This is a pretty neat idea and concept.   Not too bad when you have
already designed your solution in such a way that you have a schema
only assembly and supporting assemblies that contain your
orchestrations and so forth...    Thanks!






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:55 PM.      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