Complete the following steps to add support for a new inbound message:
- Create a new controller command or customize an existing task command to send a message with a certain message ID or name.
- Define a DTD for the new XML message. You can use the DTD files for
existing XML messages as a guide. By default, these files are located in the
following directory:
WC_installdir/CommerceServer/xml/messaging
WCDE_installdir/CommerceServer/xml/messaging
- Add the new DTD file to the system.
- Update the user_template.xml inbound message template definition file for the new message. To do this, refer to the structural guidelines outlined in Inbound message template definition files.
The following samples you can follow:
Sample message:
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE Update_New_Message SYSTEM 'Update_New_Message.dtd'> <Update_First_Element version='1.0'> <DataArea> <ABC>123456</ABC> </DataArea> </Update_First_Element>
Sample DTD file:
<!ELEMENT Update_First_Element (DataArea)> <!ATTLIST Update_First_Element version CDATA #FIXED "1.0"> <!ELEMENT DataArea (ABC)> <!ELEMENT ABC (#PCDATA)>
Sample user_template.xml:
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE ECTemplate SYSTEM 'ec_template.dtd' > <ECTemplate> <TemplateDocument> <DocumentType version='1.0'>Update_New_Message</DocumentType> <StartElement>Update_First_Element</StartElement> <TemplateTagName>NewMessageMap</TemplateTagName> <CommandMapping> <Command CommandName='NewCommand' /> </CommandMapping> </TemplateDocument> <TemplateTag name='NewMessageMap'> <Tag XPath='DataArea/ABC' Field='ABC_id' /> </TemplateTag> </ECTemplate>