Adding message mappers

To add a new message mapper, you must manually add it to the group of message mappers in the WebSphere Commerce configuration file. To add a new message mapper:

  1. Open the WebSphere Commerce configuration file.
  2. Locate MessageMapperGroup element.
  3. To define your message mapper, add a MessageMapper element as a child element to the MessageMapperGroup element.

    <component compClassName="com.ibm.commerce.programadapter.messagemapper.MessageMapperGroup"
    enable="true"
    name="MessageMapperGroup">
    <property display="false">
    <MessageMapper messageMapperId="newmapperid" 
    classname="class implementingMessageMapperinterface" 
    enable="true" 
    name="Name of Message Mapper"> 
     <configuration 
      EcSystemTemplateFile="mapping.xml" 
      EcInboundMessageDtdFiles="something.dtd" 
      EcTemplatePath="E:\users\user\test\map" 
      EcSaxParserClass="org.apache.xerces.parsers.SAXParser" 
      EcInboundMessageDtdPath="E:\users\user\test\dtd" 
      isValidating="false" 
      DebugMode="FALSE"
      EmptyElementClearsData="FALSE"/>
    </MessageMapper>
    

    where:

    messageMapperId
    The messageMapperId may be any whole number from -100 to -9999.
    classname
    The name of the class implementing the MesssageMapper interface, com.ibm.commerce.messaging.programadapter.messagemapper.ecsax.ECSAXMessageMapper, for example.

    Note that if both EcSystemTemplateFile and EcUserTemplateFile are not specified, default values from the "Messaging" tag in the WebSphere Commerce configuration file will be used. If both EcInboundMessageDtdPath and EcInboundMessageDtdFiles are not specified, the default values from the "Messaging" tag in the WebSphere Commerce configuration file will be used.

  4. Within the configuration element add any extra configuration attributes needed for the message mapper. This is converted into a TypedProperty object and passes to the init method of the message mapper.

    Note: In order to have your message mappers function properly, ensure that you are using the newer implementation class name of the XML parser, EcSaxParserClass="org.apache.xerces.parsers.SAXParser".

Feedback