Next >
Tutorial: Creating a WebSphere Commerce service module
In this tutorial you will follow the development of a sample service module, TutorialStore, based on the concept of a Store in WebSphere Commerce version 6. The services provided by the tutorial store will be Get and Process. Use the Get service to retrieve store information based on a search expression.
Learning objectives
The tutorial will demonstrate how to support the following XPath expressions.
- Find store by store id (/Store[StoreIdentifier[UniqueID='123']])
- Find store by name (/Store[StoreIdentifier[ExternalIdentifier[NameIdentifier='StoreName']]])
- Retrieve all stores (/Store)
The Process service initiates a business process for the tutorial store. For this tutorial we will demonstrate how to reuse existing WebSphere Commerce commands for the following business process actions.
- Open a store (com.ibm.commerce.store.commands.StoreOpenCmd)
- Close a store (com.ibm.commerce.store.commands.StoreCloseCmd)
For the purpose of this tutorial, the definition of the TutorialStore contains the information listed in the table below. The table shows the access profile that includes this information for the above XPath expressions.
Data Description Applicable Access Profiles Store identifier information Information to uniquely identify the store. Summary, Detail, All Store description Description information about the store. Detail, All State Whether the store is "Open", "Closed" or "Suspended." Detail, All Store category The category of the store, such as B2C or B2B. Detail, All Inventory system The inventory system used by the store. Detail, All Store path The store directory that contains the file resources associated with the store. Detail, All Supported languages The languages supported by the store. All Support currencies The currencies supported by the store. All Fulfillment center The fulfillment center associated with the store. All
Time required
Expect this tutorial to take 2 hours to complete.
Audience
This tutorial is intended for WebSphere Commerce developers who are responsible for creating and customizing WebSphere Commerce services.
Prerequisites
Before beginning this tutorial ensure that you have fulfilled the following prerequisites:
- Installed WebSphere Commerce Developer
- Installed WebSphere Commerce Developer Fix pack 2
- Installed the component-services iFeature from WebSphere Commerce enhancements for version 6
- Ensured that the WebSphere Server fix pack level of your WebSphere Test Environment is at least 6.0.2.15. RAD_installdir\runtimes\base_v6\bin\versionInfo.
- Enabled WebSphere Commerce services
- Installed the Design Pattern Toolkit and the ComponentProjects design pattern
- Unzipped the tutorial sample code, TutorialStore.zip, to a temporary location on your hard drive
Prerequisite knowledge To complete this tutorial you should be familiar with the following terms and concepts:
- WebSphere Commerce service module
- Eclipse plug-ins
- The Java programming language
- Rational Application Developer
- How to import code into Rational Application Developer
- XML and XML technologies such as XSD
- Registering commands with WebSphere Commerce
- Run SQL scripts against a relational database
Lessons in this tutorial
- Generating the TutorialStore service module projects
In this step you use the ComponentProjects Design Pattern Toolkit (DPTK) to generate the base code for your TutorialStore component.- Define the TutorialStore noun
This section refers to defining the TutorialStore noun.- Generating the SDOs for the TutorialStore noun
This tutorial refers to Generating the SDOs for the TutorialStore noun.- Implementing the component facade
This section refers to implementing the component facade.- Implementing the client library
This step adds the client-specific code to the TutorialStore-Client project that is not generated by the ComponentProjects pattern.- Deploying and validating the TutorialStore service module with JUnit
This section refers to deploying and validating the TutorialStore service module with JUnit.- Create a WebSphere Commerce service module summary
This section summarizes the tutorial. Next >