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

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

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

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

Leave a Reply

Your email address will not be published. Required fields are marked *

BizTalk360
BizTalk Server

Over 500+ customers across
30+ countries depend on BizTalk360

Learn More
Serverless360
Azure

Manage and monitor serverless
components effortlessly

Learn More
Atomicscope
Business Users

Monitor your Business Activity in iPaaS
or Hybrid integration solutions

Learn More

Back to Top