Examples: Outbound messaging using SendMsgCmd

The following Java code segment shows how interactions with the outbound messaging system can take place. Example 1 shows you how to build a new XML message and send it through the outbound messaging system. Example 2 shows you how to build an email message and send it through the outbound messaging system:


Example 1

In this example, we can use either SendMsgCmd.setContent or SendMsgCmd.compose to build a new XML message and send it through the outbound messaging system.Important: If SendMsgCmd.setContent and SendMsgCmd.compose are used together, content that is generated by composition can override the other according to the following behavior priorities:

Read the commented lines carefully and choose a method when we are copying the code snippet below. It is not recommended to use both methods, as it adds unnecessary complexity.


Example 2

In this example, we can use either SendMsgCmd.setContent or SendMsgCmd.compose to build an email message and send it through the outbound messaging system.Important: If SendMsgCmd.setContent and SendMsgCmd.compose are used together, content that is generated by composition can override the other according to the following behavior priorities:

Read the commented lines documentation carefully and choose a method when we are copying the code snippet below. It is not recommended to use both methods, as it adds unnecessary complexity.


Composition JSP files

The default view for the OrderReceived message is defined in the MSGTYPES table and is the OrderReceivedView. This view is defined in the struts configuration file, struts-config-ext.xml for WebSphere Commerce Version 9.0.0.x users and struts-wcs-stores-custom.xml for Version 9.0.1.x users. This view refers to the OrderReceivedNotify.jsp, which is used to compose the message. For WebSphere Commerce Version 9.0.0.x users, the message is as follows:

For Version 9.0.1.x users, the message is:

See the OrderReceivedNotify.jsp file for details on how the message is composed.


Related concepts
Outbound messaging system
Order notification


Related tasks
Creating an outbound message