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 ]
|