Multi-Part message – “use of unconstructed message ” – Error message when you try to build a BizTalk project

Posted: April 29, 2009 in BizTalk
Tags: ,

Sometimes when we try to build or deploy BizTalk solution, you may get the following error message:

Use of Unconstructed Message ‘MessageName’

I get this error when I try to construct a multi-part message for sending email with body and attachment.

SOLUTION

Check if you have a reference to the message before its initialize, for example:

myMessage.Body(Microsoft.XLANGs.BaseTypes.ContentType) = "text/plain";
myMessage.Body = new …;

Correct syntax:

myMessage.Body = new …;
myMessage.Body(Microsoft.XLANGs.BaseTypes.ContentType) = "text/plain";

My suggestion is, first initialize both types of the multi-part message, in my case:

myMessage.Body = new Microsoft.XLANGs.CustomFormattersSDK.RawString(“”);
myMessage.Attachment = new System.Xml.XmlDocument();

and then I define other properties of the message:

myMessage(SMTP.Subject) = …;

and magic appends!! Problem solved.

Another solution, I suggest not to use, but, if you’re positive that your response message will always have a value, you could instantiate the message, inside a construct shape, using:

myMessage.Body = null;
myMessage.Attachment = null

Tags: BizTalk | Build | Deploy | Errors and Warnings, Causes and Solutions

Comments
  1. Venu says:

    yes i too encountered this error serveral times..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s