Re: message part has not been initialized in construct statement

Home Page Forums BizTalk 2004 – BizTalk 2010 message part has not been initialized in construct statement Re: message part has not been initialized in construct statement

#20357

I get around this by doing the following:

1. Generate an instance of your schema by Right-Clicking on the schema in the Solution Explorer and selecting Generate Instance
2. Create an XmlDocument variable in the Orchestration called xmlDoc
3. Drop a Construct Message and Message Assignment shape
4. Inside of the Message Assignment shape code the following:

     xmlDoc.LoadXml(<<copy XML from generated instance in step 1 and remove element values as they are populated be default>>);

     msg = xmlDoc;

 

Why Microsoft didn’t include a way to create a new instance of a message from a supplied schema is beyond me!?