BizTalk Server Orchestration – message has not been initialized in construct statement
This may sound very basic…but…
When using the MessageAssignment orchestration shape, if the message you are using has not been instantiated by a map or a port then you must manually instantiate the message:
Message_Type = new System.Xml.XmlDocument();
//Now that the message has been instantiated it can be used.
Message_Type.[PropertyName] = “Property Value”;
goddam you are a savior π
Hi John thanks for this Reply. Its Worked for me like magic. The Error resolved
Thanks for the comment. I’m glad you got your error resolved!
Hi John,
i was trying to slove that issue from last 2 days. no one, even microsoft on their so called knowledge base web site, did not gave solution.
i will simply say, you are Amazing! yes.
thanks
Genious
http://www.worldwebdirectory.co.uk
it solved my issue as well
But I dont understand how to to resolve this issue with trnsaform shape and
How I can assign values in expressions
The Transform shape can only be used to call a map. You cannot technically assign values to a message in an Expression shape. It can only be done within a Message Assignment shape. I have seen use of the construct {} statement used in an Expression shape. But, I believe it is clearer in an Orchestration to always use the Message Assignment shape for this purpose. I believe the resultant XLang is the same as using the construct {} statement within an Expression shape.
This link may be helpful to you…
http://geekswithblogs.net/michaelstephenson/archive/2006/09/26/92363.aspx
Hi Jglisson
I have construct the message as you but I get this error
“Inner exception: A failure occurred while evaluating the distinguished field FileName against the message part data. The message part data does not contain at least one of the nodes specified by the XPath expression (listed below) that corresponds to the distinguished field. The cause for this error may be that the message part data has not been initialized or that the message part data does not conform to the message part schema. Ensure that the message part data is initialized correctly. XPath expression: /*[local-name()=’FileContent’ and namespace-uri()=’http://SaveFileNameToDB.Schemas.FileContent’]/*[local-name()=’FileName’ and namespace-uri()=”]”
below is code in assignment shape:
MsgFileContent = new System.Xml.XmlDocument();
MsgFileContent.FileName = MsgPO(FILE.ReceivedFileName);
with:
MsgFileContent is the message created on FileContent schema.
MsgFileContent.FileName with FileName is the element of filecontent schema
I think this cause, the MsgFileContent is not xml document type.
In this case you will have to actually populate the message with stubbed out XML before you can assign values to it. To do this, you will need a variable of XmlDocument.
Go to your schema, generate an instance, and copy/paste that into your assign shape as follows.
varXml = new System.Xml.XmlDocument();
varXml.LoadXml(@”[paste your xml here]”);
MsgFileContent = varXml;
MsgFileContent.FileName = MsgPO(FILE.ReceivedFileName);
That should get you moving along.
Thanks a lot bro… π
Cheers..