Administer > Manage WebSphere Commerce features > WebSphere Commerce integration with WebSphere Portal > Maintain the WebSphere Commerce portlet application
Add a new WebSphere Commerce component service to MVCPortlet
After creating a new WebSphere Commerce component service, register the client library and its runtime objects to the MVCPortlet application for the new component service to be available for use in the MVCPortlets.
When updating an existing WebSphere Commerce component service in the MVCPortlet application, be aware of the following components inside of the MVCPortlet application:
- Runtime libraries
- Client library JAR
- Data object JAR
- Deployment descriptor
- Component service WSDL
- Service handler
- Component service configuration
- get-data-config.xml
- SDO.properties
- wc-component-client.xml
Before you begin
Ensure that you have completed the following tasks when upgrading the Foundation runtime libraries in the MVCPortlet application:
- Setup the WebSphere Portal development environment.
- Update the Foundation runtime libraries:
- Right-click the MVCPortlet/WebContent/WEB-INF/lib directory in the Project Explorer.
- Select Import > General > File System.
- Click Next.
- Click Browse and navigate to the wc.modules/workspace/WC directory from the WebSphere Commerce installation.
- Select the Foundation runtime library JAR files:
- Foundation-Core.jar
- Foundation-DataObjects.jar
- Foundation-Samples.jar
- Foundation-Taglib.jar
- Click Finish.
- Import the Foundation schema definitions:
- Right-click the MVCPortlet/WebContent/WEB-INF directory in the Project Explorer.
- Select Import > General > File System.
- Click Next.
- Click Browse and navigate to the wc.modules/workspace/WebServicesRouter/WebContent directory from the WebSphere Commerce installation.
- Select the xsd directory.
- Click Finish.
- Verify the JAX-RPC Web service generation settings:
- Select Window > Preferences.
- Select Web Services.
- Select WebSphere.
- Select Select JAX-RPC Code Generation.
- Select the WSDL2Java tab.
- Select Disable data binding and use SOAP element.
- Click OK.
- Select Window > Preferences.
- Select Web Services.
- Select Scenario Defaults.
- Select Java Proxy for Client Type.
- Select Deploy Client in the slider.
- Click OK.
- Select Window > Preferences.
- Select Server Runtime.
- Select WebSphere Application Server v7 as the Server.
- Select IBM WebSphere JAX-RPC as the Web service runtime.
- Click OK.
Procedure
- Determine which WebSphere Commerce component service to add to the MVCPortlet application. For example: MyCatalog.
- Import the component service client library:
- Right-click the MVCPortlet/WebContent/WEB-INF/lib directory in the Project Explorer.
- Select Import > General > File System.
- Click Next.
- Click Browse and navigate to the wc.modules/workspace/WC directory of the WebSphere Commerce installation.
- Select the component service client library JAR files. For example: MyCatalog-Client.jar, MyCatalogData-Objects.jar.
- Click Finish.
- Click Yes to overwrite the existing version of the JAR file in the workspace.
- Configure the component service client library:
- Expand the MVCPortlet project to MVCPortlet/Java Resources: src/config.
- Right-click the directory with the component name, for example, com.mycompany.commerce.mycatalog, and select Import > General > File System.
- Click Next.
- Click Browse and navigate to the xml/config/component_name directory of the WebSphere Commerce installation, where component_name is the name of the component service. For example: com.ibm.commerce.catalog.
- Select the component service SDO.properties client configuration file.
- Click Finish.
- Click Yes to overwrite the existing version of the file in the workspace.
- Configure the get-data JSTL tag library:
- Expand the MVCPortlet project to MVCPortlet/WebContent/WEB-INF/config.
- Right-click the directory with the component name, for example, com.mycompany.commerce.mycatalog, and select Import > General > File System.
- Click Next.
- Click Browse and navigate to the Stores/WebContent/WEB-INF/config/component_name directory within the workspace, where component_name is the name of the component service. For example: com.ibm.commerce.catalog.
- Select the get-data-config.xml configuration files.
- Click Finish.
- Click Yes to overwrite the existing version of the file in the workspace.
- Enable the component service in the MVCPortlet application:
- Import the component service WSDL:
- Right-click MVCPortlet/WebContent/WEB-INF/wsdl.
- Select Import > General > File System.
- Click Next.
- Click Browse and navigate to the wc.modules/workspace/WebServicesRouter/WebContent/component-services/wsdl directory of the WebSphere Commerce installation.
- Select a component service WSDL file. For example: CatalogServices.wsdl.
- Click Finish.
- Click Yes to overwrite the existing version of the file in the workspace.
- If you are using the TCP monitor to forward the service request to the WebSphere Commerce server, update the SOAP address binding at the end of this WSDL file by replacing http://localhost/ with http://localhost:81/. Port 81 is the port number that the TCP monitor will listen on the localhost.
- Generate the JAX-RPC Web service:
- Right-click the newly imported WSDL file, for example, CatalogServices.wsdl, in the MVCPortlet/WebContent/WEB-INF/wsdl directory.
- Select Web Services.
- Select Generate Client and click Finish.
- Accept all warnings related to Automatic File Overwriting.
- Associate the JAX-RPC Web service handler to the component service:
- Open the WAR deployment descriptor, MVCPortlet/WebContent/WEB-INF/web.xml.
- Select the WS Handler tab.
- In the Service references list, select the newly imported component service reference, for example, service/MyCatalogServices.
- Click Add.
- Enter the following information:
- Display name
- For example, MyCatalog Handler.
- Handler name
- For example, MyCatalog Handler.
- Handler class
- com.ibm.commerce.foundation.internal.client.services.invocation.impl.JAXRPCWebServiceProxyHandlerImpl
- Configure additional deployment settings in the WebSphere Portal runtime environment:
After you have installed the MVCPortlet application to the WebSphere Portal runtime environment, in addition to the typical configuration that do for the basic component services, also define the Web service endpoint URL for the newly added component service using the WebSphere Application Server administration console:
- Log on to the WebSphere Application Server administrative console using the WebSphere Portal secure user.
- Click Applications > Enterprise Applications.
- Select the enterprise application that was used for deploying the MVCPortlet application.
- Select Web Modules.
- Select the MVCPortlet.war file and click Web services client bindings.
- For each Web service, click Edit link in the Port Information column.
- Change the Overridden EndPoint URL for the new component service.
For example:
- http://hostname:8007/webapp/wcs/component/mycatalog/services/MyCatalogServices