Deploying the client library
The client library for an HCL Commerce service can be deployed in one of four possible environments:
- A generated web service client proxy binding.
- A local EJB binding.
- A web service binding in a J2SE application.
- A service binding using the HCL Commerce JCA Messaging subsystem.
- WebSphere Application Server Version 7 runtime
- com.ibm.ws.webservices.thinclient_7.0.0.jar
Before you begin
Procedure
To deploy the client library:
- Start HCL Commerce Developer..
- Package the client library:
- If you are packaging your own client application, you must include
the following JAR files in the class path of your client application:
- MyServiceModule-Client.jar, where MyServiceModule is the name of your service module
- MyServiceModule-DataObjects.jar
- workspace_dir\WC\Foundation-Core.jar
- workspace_dir\WC\Foundation-DataObjects.jar
- workspace_dir\WC\Performance-Profiler.jar
- If you are packaging your own client application, you must include
the following JAR files in the class path of your client application:
- Copy workspace_dir\WC\xml\config\com.ibm.commerce.foundation\wc-config-mapping-registry.xml and SDO.properties to
any \config directory in the client application
class path. (The file must be in a directory called config).Note: The wc-config-mapping-registry.xml file is part of the client library configuration, and registers component configurations in the Foundation configuration mapping registry.
See the wc-config-mapping-registry.xml file for a sample configuration.
- In the class path of the client application, create an
empty folder that is called config\component-id,
where component-id is the identifier for your
component.For example, com.myco.commerce.myservicemodule.
- Copy an existing wc-component-client.xml file into your newcomponent-id folder. The existing wc-component-client.xml are in the workspace_dir\WC\xml\config\com.ibm.commerce.component-id directory, where component-id is the name of the component, such as catalog or content. You must edit the copied file for use with your component service.
- Select one of the following binding methods, which are
based on the authentication mechanism you chose:
Option Description Generated web service client proxy binding: - Open Disable data binding and use SOAPElement option. . Select the
- Open the Java EE module that uses the client library in the Deployment Descriptor editor.
- Click the References tab and add a service
reference. Then, select the Next button.
- Select the service reference and select the Finish button.
- Click the WS Handler tab and create a
new handler for the newly created service reference. The handler class
should be
com.ibm.commerce.foundation.internal.client.services.invocation.impl.JAXRPCWebServiceProxyHandlerImpl
. The purpose of this handler is to include authorization information within the SOAP request for guest and register user support. - Open the file that you created in step 4 and use the generated
proxy class by changing the invocation binding implementation to
com.ibm.commerce.foundation.internal.client.services.invocation.impl.JAXRPCWebServiceProxyInvocationBindingImpl
. Add a proxy to this binding element namedproxyClass
with the value of the generated proxy class. For example:<_config:invocationservice> <_config:invocationbinding bindingImpl="com.ibm.commerce.foundation.internal.client.services.invocation.imp l.JAXRPCWebServiceProxyInvocationBindingImpl"> <_config:property name="proxyClass" value="com.ibm.www.CatalogServicesPortTypeProxy"/> </_config:invocationbinding> </_config:invocationservice>
- Use the administrative console to manage the URL binding and security
setting to associate it with the web service configuration.
Local EJB binding When the HCL Commerce service and the client of that service are in the same application. For performance reasons, the client should not have to make a web service request to that service. Instead, the client and component communication should be local to the application to avoid unnecessary service requests.
- Open the
wc-component-client.xml
file that you created in step 4 and change the invocation binding to use:com.ibm.commerce.foundation.internal.client.services.invocation.impl.LocalEJBInvocationBindingImpl
- Add a
jndiName
property of the binding to point to the global name of the local EJB component. For example:<_config:InvocationBinding bindingImpl="com.ibm.commerce.foundation.internal.client.services.invocation.impl.LocalEJBInvocationBindingImpl"> <_config:Property name="jndiName" value="ejb/com/ibm/commerce/catalog/facade/server/CatalogLocalFacadeHome"/> </_config:InvocationBinding>
- Save the file.
- Deploy the changed configuration.
- Restart the server.
Web services binding in a J2SE application When the client of the HCL Commerce service is deployed in a J2SE environment, there is no naming service to resolve the reference to the web service. Instead, the URL binding of the web service is defined in the binding configuration of the client.
- Open the
wc-component-client.xml
file that you created in step 4 and change the invocation binding to use:com.ibm.commerce.foundation.internal.client.services.invocation.impl.J2SEWebServiceInvocationBindingImpl
- Add a URL property to the binding to specify the URL where the
web service can be found. For example:
<_config:InvocationBinding bindingImpl="com.ibm.commerce.foundation.internal.client.services.invocation.impl.J2SEWebServiceInvocationBindingImpl"> <_config:Property name="url" value="http://localhost:81/webapp/wcs/component/catalog/services/CatalogServices"/> </_config:InvocationBinding>
- Save the file.
- Deploy the changed configuration.
- Restart the server.
Service binding using the HCL Commerce JCA Messaging subsystem When the client of the service is deployed in the HCL Commerce application, the JCA infrastructure of the messaging sub system can be used to issue the service request. With this configuration, the existing messaging admin UI can be used to determine the transport and target of the system to receive the message.
- Open the wc-component-client.xml file that
you created in step 4 and change the invocation binding to use:
com.ibm.commerce.foundation.internal.client.services.invocation.impl.JCAInvocationBindingImpl
- Save the file.
- Deploy the changed configuration.
- Create a message type for the component ID used to create an instance
of the invocation service object, for example
com.myco.commerce.myservicemodule
. To do so, add a row into the MSGTYPES table to assign a newmsgtype_id
. Use a message type ID number above 1000. For example:insert into MSGTYPES (MSGTYPE_ID, MSGTDIR, NAME, VIEWNAME, DESCRIPTION) VALUES (1001, 1, '
com.myco.commerce.myservicemodule
' , '', 'My Service Component' ); - Assign a message type to a transport method for the site or store.
- Restart the server.