1. Create a new controller Command:
Package Name: com.mycompany.commerce.commands
Interface Name :com.mycompany.commerce.commands.MyCompanyControllerCmd
Class Name:com.mycompany.commerce.commands.MyCompanyControllerCmdImpl
Interface and impl class
2. Then Run the RESTClassicSampleGen.bat file from "C:/IBM/WCDE_ENT70/bin/" for generate the xml mapping files and handler classes.
RESTClassicSampleGen.bat
location=com.mycompany.commerce.commands.MyCompanyControllerCmd
outputDir=C:\RESTconfig
additionalClassPath="C:\IBM\WCDE_ENT70\workspace\WebSphereCommerceServerExtensionsLogic\bin"
3. If successfully runs, then the following 2 folder are created in "C:\RESTconfig"
- controllerCommandSamples
- handlerSamples
4. In the Enterprise Explorer view, go to .
Open the com.mycompany.commerce.commands.MyCompanyControllerCmd.xml file.
Change the profile name from sample to MyCommand_Summary and add the input and output parameters for the rest command.
The following snippet shows the updated code:
<?xml version="1.0" encoding="UTF-8"?>
<command>
<profiles>
<profile name="MyCommand_Summary">
<inputs>
<input inputName="field1" methodName="setField1"/>
<input inputName="field2" methodName="setField2"/>
</inputs>
<outputs>
<output methodName="getMyResourceId" outputName="myResourceId"/>
</outputs>
</profile>
</profiles>
</command>
6.Update Handler
No comments:
Post a Comment