Enabling HCL Commerce as a service provider

You can enable a business operation defined by HCL Commerce as a Web service. In this scenario, HCL Commerce acts as the service provider to external systems.

About this task

To make an HCL Commerce business operation available as a Web service:

Procedure

  1. Identify the business logic that you want to expose as a Web service.
  2. Identify the controller command that represents this business logic. If it is not available, then create a new controller command. You can write new commands to call a collection of existing commands.
  3. Identify the mandatory and optional parameters that this command requires.
  4. Create a WSDL description for the Web service. HCL Commerce provides WSDL files to describe its Web services.
    The HCL Commerce WSDL files are located in the following directories:
    • workspace_dir/WebServicesRouter/WebContent/component-services/wsdl
    If you are creating a Web client based on the WSDL files, you can copy the WSDL files into your development environment. Any WSDL files located in other directories can be ignored.

    Or, to create one from scratch, follow this lesson: ../../tutorials/tutorial/twvinboundws_2c.html.

  5. Register the WSDL description.

    Enabling HCL Commerce to handle the web service: To map the WSDL document to the Web services framework you must enable HCL Commerce to handle the Web service. Enabling the HCL Commerce Web Service framework to handle the WSDL defined previously involves two steps. The first step is configuring the HCL Commerce Web Services runtime to delegate the Web Service request to the HCL Commerce Web Services framework. The second step is configuring the HCL Commerce Web Services to process the request. This configuration is done by using the message mapping facility to convert the XML request to a name-value-pair. The name-value-pair passes to the business logic and JSP to handle the response and configure the JSP that generates the web service response.

    Mapping the WSDL to the HCL Commerce web services framework: The approach taken in HCL Commerce is to map the WSDL to the HCL Commerce Web Services framework. The Web Services tooling can be used to create and update existing deployment files to generate this mapping. By using the wizard to generate a Java Bean Skeleton, you generate the required files to create the mapping and update the web services deployment descriptors to register the new WSDL.

    For more information, follow this lesson: ../../tutorials/tutorial/twvinboundws_2d.html.

  6. Write a JSP page to compose a response.
  7. Deploy the service. This includes the deployment of related files and resources. In case of a new command, you must deploy and register it in the HCL Commerce command registry.