Tutorials > Program model > Web services > Create a new WebSphere Commerce BOD service module

< Previous | Next >


Add language specific exception messages

In this step you add language-specific exception messages to the properties files used by mediators and commands. You will write the mediator and command code in a later lesson.

To add language specific exception messages:


Procedure

  1. Open BODTutorialStore-Server/ejbModule/com.mycompany.commerce.bodtutorialstore.logging/BODTutorialStoreApplicationMessageKeys.java and paste the following into the interface body:

    public static final String _ERR_UPDATE_NON_EXIST_STORE = "_ERR_UPDATE_NON_EXIST_STORE";
    public static final String _ERR_DELETE_OR_UPDATE_NON_EXIST_STORE_DESCRIPTION = "_ERR_DELETE_OR_UPDATE_NON_EXIST_STORE_DESCRIPTION";
    public static final String _ERR_CREATE_DUPLICATE_STORE_DESCRIPTION = "_ERR_CREATE_DUPLICATE_STORE_DESCRIPTION";
    public static final String _ERR_CREATE_ACTION_NOT_SUPPORTED = "_ERR_CREATE_ACTION_NOT_SUPPORTED";
    public static final String _ERR_DELETE_ACTION_NOT_SUPPORTED = "_ERR_DELETE_ACTION_NOT_SUPPORTED";
    public static final String _ERR_MISSING_STORE_IDENTIFIER = "_ERR_MISSING_STORE_IDENTIFIER";
    public static final String _ERR_MISSING_DESCRIPTION_LANGUAGE = "_ERR_MISSING_DESCRIPTION_LANGUAGE";
    

  2. Save the changes to the file.

  3. Open BODTutorialStore-Server/com.mycompany.commerce.bodtutorialstore.logging.properties/BODTutorialStoreMessages.properties

  4. Overwrite the contents of this property file with the following:

    _ERR_UPDATE_NON_EXIST_STORE = Could not find store {0}.
    _ERR_DELETE_OR_UPDATE_NON_EXIST_STORE_DESCRIPTION = Could not find store {0} and store description {1}.
    _ERR_CREATE_DUPLICATE_STORE_DESCRIPTION = Store {0} and store description {1} already exist.
    _ERR_CREATE_ACTION_NOT_SUPPORTED = The create action is not supported for noun {0}.
    _ERR_DELETE_ACTION_NOT_SUPPORTED = The delete action is not supported for noun {0}.
    _ERR_MISSING_STORE_IDENTIFIER = The request is missing a store identifier for noun {0}.
    _ERR_MISSING_DESCRIPTION_LANGUAGE = The request is missing the description language for store {0} and store description {1}.
    

  5. Save the changes to the file.

< Previous | Next >


+

Search Tips   |   Advanced Search