Tutorial: Creating and customizing REST services by using the configuration-based controller command and data bean mapping framework
REST services help facilitate the invocation of classic controller commands and the activation of data beans. The REST framework is easy to learn and customize. The framework creates custom REST resource handlers that start controller commands to create, update and delete operations, and activate data beans to retrieve data. To simplify the creation and consumption of REST APIs, WebSphere Commerce provides a utility to create configuration-based controller command and data bean mappings. The utility auto-generates the configuration mapping files and sample handler code for your custom data bean or controller command. It explicitly describes what input is required and what data returns from execution, which reduces the customization effort.
You can create custom handlers to access to your own data beans and controller commands easily. Alternatively, you can use the default REST beans and controller commands to return an augmented set of response data to satisfy your customization requirements.
- Create a REST handler for mapping the custom data bean and controller command
- Customize an existing configuration-based data bean mapping to return more data
Time required
Expect this tutorial to take 2 - 3 hours to complete. The tutorial takes longer if you explore concepts that are related to this tutorial.Skill level
This tutorial is intended for advanced WebSphere Commerce developers responsible for customizing store preview feature. To complete this tutorial, you must be familiar with the following terms and concepts:- Web service
- REST service
- Widgets definition
- SQL
- XML
- XPath
- Rational Application Developer
- JSP/JSPF
- Java
- REST mapping command: restClassicSampleGen.bat
System requirements
Before you begin this tutorial, ensure that you install:- WebSphere Commerce Developer Version 7
- WebSphere Commerce Developer Feature Pack 8