Creating an outbound message
In addition to the supported XML and WebSphere Commerce outbound messages, you can add support for new outbound messages. To add a new outbound message, you must write a new controller command to build the content of the new outbound message and send the message to the back-end system using the send services of the outbound messaging system.
About this task
Outbound messaging system interface
Interactions
with the outbound messaging system can be done through the SendMsgCmd
task command. This task command externalizes all available interfaces
to methods provided by the messaging system to set necessary parameters
to construct and use the messaging system object. The following is
a list of all available services in the SendMsgCmd command interface:
Procedure
- Create a new controller command or customize an existing task command to send a message with a certain message ID or name.
- Add a row into MSGTYPES table assign a msgtype_id with a new viewname, based on the command. Use a message type ID number above 1000. Prepend the viewname and message type name with your company name.
- Create a new row with the name in WebSphere Commerce Struts framework and assign the devicefmt_id, and JSP page (with the full path).
- Create a profile in the PROFILE table using the Administration
Console, and assign the message type to the correct transport (for
example, e-mail) and device format (for example, standard device format).
See Assigning
a message type to a transport method for a site or store. A
valid device format ID, as specified in the Struts configuration file,
must be specified for each transport to be used. This device format
ID (for example, DEVICEFMT_ID) must match with the one added into
Struts configuration files in order to be able to pick the right JSP
template file for composition. The following are the values you should
use in the Struts configuration file:
SOAP XML data transmitted via HTTP = -1 HTTP Browser = Reserved for IBM Standard Device Format = -3 IBM MQ Adapter for XML = -4 IBM MQ Adapter for WCS (Legacy message) = -5
Note: Most predefined message types (regardless for which transport they were designed) are designed to use the standard device format. What choice to pick is strictly dependent on how the entries for the Struts configuration file are created. The default values of device format ID may change in future releases. - Create a messaging system object using the SendMsgCmd task command. Use the setMsgType(String) and setStoreId(Integer) described in the topic Initialization services.
- Invoke the SendMsgCmd.execute() method.