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:

  1. 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.

  2. 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.

  3. Deploy the WAR module through the WAS console:

    1. Select Applications > Enterprise Applications.

    2. Select the WebSphere Commerce instance and click Update.

    3. Select Single Module.

    4. Specify Relative Path as MyServiceModule-ServicesHTTPInterface.war.

    5. Select Local file system and specify the location of the WAR file.

    6. Specify Context root as /webapp/wcs/component/ MyServiceModule. Click Next.

    7. Accept the defaults and click Next again.

    8. Click Continue to go through security warnings.

    9. Accept defaults on Step 1 and click Next.

    10. Select both options under Clusters and Servers, select MyServiceModule-ServicesHTTPInterfaceModule, and click Apply. Click Next.

    11. Select MyServiceModule-ServicesHTTPInterface module and select VH_ instance as the virtual host.

    12. Click Next. Click Finish. Click Save to Master Configuration.

  4. (Optional) Deploy MyServiceModuleServicesJMSInterface.jar through the console:

    1. Select Applications > Enterprise Applications.

    2. Select the WebSphere Commerce instance and click Update.

    3. Select Single Module.

    4. Specify Relative Path as MyServiceModuleServicesJMSInterface.jar.

    5. Select Local file system and specify the location of the JAR file.

    6. Leave Context root blank. Click Next.

    7. Accept the defaults and click Next again.

    8. Click Continue to go through security warnings.

    9. Accept the defaults on Step 1 and click Next.

    10. Select both options under Clusters and Servers, select MyServiceModuleServicesJMSInterface Module, and click Apply; click Next.

    11. Accept defaults and click Next.

    12. Accept defaults and click Next.

    13. Click Finish.

    14. Click Save to Master Configuration.

  5. Deploy MyServiceModule-Client.jar and MyServiceModule-DataObjects.jar through the administrative console:

    1. Select Applications > Enterprise Applications.

    2. Select the WebSphere Commerce instance and click Update.

    3. Select Single File.

    4. Specify Relative Path as MyServiceModule-Client.jar.

    5. Select Local file system and specify the location of the JAR file.

    6. Click Next.

    7. Click OK to update the WebSphere Commerce instance.

    8. Click Save to Master Configuration.

    9. Repeat steps a through h for MyServiceModule-DataObjects.jar.

  6. 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.

    1. In a command prompt window, navigate to under WC_profiledir/bin, then type wsadmin to bring up the wsadmin prompt.

    2. 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

      1. $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}} 
                } ]
        

      2. global AdminConfig
        

      3. $AdminConfig save
        

  7. Add the Service Module configuration to the runtime server:

    1. Add the SDO.properties and wc-component-client.xml files to WC_eardir\xml\config\com.mycompany.commerce.myservicemodule\

    2. Add the Service Module command registry updates.

    3. Add the Service Module message mapping updates.

  8. Generate a new Web server plug-in:

    1. Open the WAS administrative console.

    2. Select Servers > Web servers.

    3. Select webserver1.

    4. Click Generate Plug-in.

    5. Restart the Web server.

    6. Restart the WebSphere Commerce Server.

Related concepts

WebSphere Commerce services
WebSphere Commerce service module
Component facade interfaces
Command, view, and URL registries
Message mappers

Related tasks

Create the component facade