Deploying the component facade
After you have
created your WebSphere Commerce service module,
created your component facade, and tested to your satisfaction, you are ready to deploy the component facade to your WebSphere Commerce Server.To deploy a component facade on the WebSphere Commerce runtime environment:
- Export all projects (except the unit tests project) from the service module:
- MyServiceModule-Client
- Contains the client library Java code. Export this as a JAR file.
- MyServiceModule-DataObjects
- Contains the XSD, WSDL, and generated SDOs. Export this as a JAR file.
- MyServiceModule-Server
- Contains the component facade implementation. Export this as an EJB JAR file.
- MyServiceModuleServicesHTTPInterface
- The Web module used to enable the service module for Web services over HTTP. Export this as a WAR file.
- (Optional) MyServiceModuleServicesJMSInterface
- The EJB module used to enable the service module for Web services over JMS. Export this as an EJB JAR file.
- Edit MANIFEST.MF under MyServiceModule-Server.jar to confirm that it includes the following entries:
- Class-Path: Foundation-Server.jar
- Foundation-Core.jar
- Foundation-DataObjects.jar
- Foundation-Extension.jar
- MyServiceModule-Client.jar
- MyServiceModule-DataObjects.jar
- Any additional JAR files your component facade implementation depends on
Step 3 and 4 can be interchanged in deployment order, but step 5 MUST come after both step 3 and step 4 are complete.
- Deploy the WAR module through the WAS console:
- Select Applications > Enterprise Applications.
- Select the WebSphere Commerce instance and click Update.
- Select Single Module.
- Specify Relative Path as MyServiceModule-ServicesHTTPInterface.war.
- Select Local file system and specify the location of the WAR file.
- Specify Context root as /webapp/wcs/component/ MyServiceModule. Click Next.
- Accept the defaults and click Next again.
- Click Continue to go through security warnings.
- Accept defaults on Step 1 and click Next.
- Select both options under Clusters and Servers, select MyServiceModule-ServicesHTTPInterfaceModule, and click Apply. Click Next.
- Select MyServiceModule-ServicesHTTPInterface module and select VH_ instance as the virtual host.
- Click Next. Click Finish. Click Save to Master Configuration.
- (Optional) Deploy MyServiceModuleServicesJMSInterface.jar through the console:
- Select Applications > Enterprise Applications.
- Select the WebSphere Commerce instance and click Update.
- Select Single Module.
- Specify Relative Path as MyServiceModuleServicesJMSInterface.jar.
- Select Local file system and specify the location of the JAR file.
- Leave Context root blank. Click Next.
- Accept the defaults and click Next again.
- Click Continue to go through security warnings.
- Accept the defaults on Step 1 and click Next.
- Select both options under Clusters and Servers, select MyServiceModuleServicesJMSInterface Module, and click Apply; click Next.
- Accept defaults and click Next.
- Accept defaults and click Next.
- Click Finish.
- Click Save to Master Configuration.
- Deploy MyServiceModule-Client.jar and MyServiceModule-DataObjects.jar through the administrative console:
- Select Applications > Enterprise Applications.
- Select the WebSphere Commerce instance and click Update.
- Select Single File.
- Specify Relative Path as MyServiceModule-Client.jar.
- Select Local file system and specify the location of the JAR file.
- Click Next.
- Click OK to update the WebSphere Commerce instance.
- Click Save to Master Configuration.
- Repeat steps a through h for MyServiceModule-DataObjects.jar.
- Due to a technical limitation in the WebSphere Application server, normal EJB deployment steps cannot be followed, and the wsadmin command line tool must be used.
- In a command prompt window, navigate to under WC_profiledir/bin, then type wsadmin to bring up the wsadmin prompt.
- Run the following commands from the wsadmin prompt, replacing:
- MyServiceModule with the name of your service module
- WC_demo_cell with your cell
- WC_demo_node with your node
$AdminApp update WC_demo modulefile [subst {-operation addupdate -contents MyServiceModule-Server.jar -contenturi MyServiceModule-Server.jar -nodeployejb -usedefaultbindings -defaultbinding.datasource.jndi "jdbc/WebSphere Commerce DB2 DataSource demo" -defaultbinding.cf.jndi "jdbc/WebSphere Commerce DB2 DataSource demo" -custom com.ibm.ws.webservices.validateEJBJAR=false -defaultbinding.cf.resauth Per_Connection_Factory -MapModulesToServers {{MyServiceModule-Server MyServiceModule-Server.jar,META-INF/ejb-jar.xml +WebSphere:cell=WC_demo_cell,node=WC_demo_node,server=server1}} } ] global AdminConfig $AdminConfig save
- Add the Service Module configuration to the runtime server:
- Add the SDO.properties and wc-component-client.xml files to WC_eardir\xml\config\com.mycompany.commerce.myservicemodule\
- Add the Service Module command registry updates.
- Add the Service Module message mapping updates.
- Generate a new Web server plug-in:
- Open the WAS administrative console.
- Select Servers > Web servers.
- Select webserver1.
- Click Generate Plug-in.
- Restart the Web server.
- Restart the WebSphere Commerce Server.
Related concepts
WebSphere Commerce services
WebSphere Commerce service module
Component facade interfaces
Command, view, and URL registries
Message mappersRelated tasks
Create the component facade