A message assembly is an object that is used to represent an instance of a message at a
given point in time as it is being processed by a message flow. The message assembly contains the
message headers and payload (which can be XML, JSON, DFDL or BLOB data), together with the
environment tree, the local environment tree, and the exception list tree. The contents of the
message assembly are accessed and modified by each message flow node as the message is processed.
For examples of messages that were created by using the Message Assembly Editor, see the
following topics:
You can create a message assembly by completing the following steps:
In the Application Development view of the IBM App Connect
Enterprise Toolkit,
right-click the test project that will contain your message assembly, and then click
New > Message Assembly.
In the Create a message assembly window, enter a name for your new
message assembly and then click Finish.
The Message Assembly
Editor is displayed.
Right-click the MessageAssembly tag in the displayed table. A menu is
displayed, which you can use to create each tree in the message assembly (Environment, Local
Environment, Exception List, and Message):
Add an environment tree to the message assembly:
Select Add Environment to add an environment tree. An
environment tag is added to the message assembly.
Add elements to the environment tree, by right-clicking the
environment tag and then clicking Add
child > Element.
Add attributes to the element by right-clicking the element and then clicking
Add Attribute.
Add the local environment tree to the message assembly:
Right-click the MessageAssembly tag and click Add Local
Environment.
The Create Local Environment Tree
window is displayed.
Select the entries that you want to add to the local environment tree.
You
can expand the entries and select individual elements or folders.
When you have finished adding entries to the local environment tree, click
Finish.
The local environment entries are shown in the
Message Assembly Editor.
You can add further entries to the local environment tree by right-clicking the
localEnviroment element and then clicking Select and add
elements.
Click Finish.
Add an exception list tree to the message assembly:
Right-click the MessageAssembly tag and then click Add
Exception List.
To add entries to the exception list tree, right-click exceptionList,
click Add Exception List entry, and then select the specific types of
exception that you want to add to the tree.
The entries are added to the exception
list tree. You can also add nested exceptions and extra inserts.
Add the message tree to the message assembly:
Right-click the MessageAssembly tag and then click Add
Message.
The Create Message Tree window is
displayed.
Select the transport protocol and message body parser for the message tree.
Choose one of the following transport protocols: HTTP, SOAP,
MQ, TCPIP, File, or Other.
If
you select HTTP, an HTTPInputHeader is added automatically. If you
select MQ, an MQMD is added automatically.
The value for
ReplyProtocol in the Properties tree is set based on the selected transport. For
example, if you select MQ, the ReplyProtocol property is set
to MQ.
Choose one of the following message body parsers: XMLNSC, JSON
(Object), JSON (Array), DFDL, or
BLOB.
Set values for the properties and headers that you require for your unit test.
XMLNSC and
DFDL message body parsers require a root element, which you can add by selecting them from the
context menu. For XMLNSC, you can add elements and attributes. For DFDL, you can add elements but no
attributes.
For a JSON Object, you can add a child element that is a JSON Object or JSON
Array. For a JSON Array, you can add a child element that is a JSON Array Item. For a JSON Array
Item, you can add a child element that is a JSON Object or JSON Array.
Elements that contain
child elements do not have a type associated with them, but you can associate a type with each of
the child elements. When you select a type, validation is performed and the type is set in the
iib:valueType attribute.
Click Finish.
The properties tree and message domain
element are added under the message.
Add message headers by right-clicking the message element and then
clicking either Add HTTP Header or Add MQ Header, and
then selecting the type of header.
For HTTP, you can add one of the following headers: Input,
Reply, Request, or Response.
For MQ, you can add one of the following headers: MQMD,
Dead Letter, MQRFH2, or MQRFH2C.