Develop > Persistence layer > Work with WebSphere Commerce services > Create the component facade


Deploy the component facade

After you have tested to the satisfaction, you are ready to deploy the component facade to the WebSphere Commerce Server.


Before you begin


Procedure

  1. Export all projects (except the unit tests project) from the service module:

    Option Description
    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 the 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 WebSphere Application Server administrative console:

    1. Select Applications > Enterprise Applications.

    2. Select the WCS 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 administrative console:

    1. Select Applications > Enterprise Applications.

    2. Select the WCS 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 WCS 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_PROFILE/bin, then type wsadmin to open the wsadmin prompt.

    2. Run the following commands from the wsadmin prompt, replacing:

      • MyServiceModule with the name of the service module

      • WC_demo_cell with the cell_name

      • WC_demo_node with the node_name

      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_EAR\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 WebSphere Application Server 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 Web services

WebSphere Commerce service module

Component facade interfaces

Command, view, and URL registries

Message mappers


Related tasks

Create the component facade


+

Search Tips   |   Advanced Search