WebServicesRouter Web module configuration
HCL Commerce Developer workspace contains a project named WebServicesRouter. This project is intended to define all the Web services that your HCL Commerce instance will provide; that is, it will contain all the WSDL, XML, and configuration files needed to define business logic that will be available as Web services. You should use this project to define new services, update existing services, and for any other Web service development tasks.
URI mapping
For security reasons, by default Web services are associated with the Tools Virtual Host (port 8000) on the HCL Commerce Server, as it is a secure port (SSL only). HCL Commerce Developer operates on all HCL Commerce enabled ports. Web services can contain sensitive data and there is significant risk in putting Web services on port 80 in a production environment.
The
WebServicesRouter Web module is mapped to the context root /webapp/wcs
.
The Web services runtime appends /services/ port
type to get the complete URI. The port type
is defined in the WSDL where the Web service is declared.
Project layout
The following figure demonstrates the directory layout of the WebServicesRouter project:
Configuration files
File | Description |
---|---|
*.wsdl | This file defines the component service and all the operations it offers. This is the file that will be exposed to Web service clients as a definition of the services provided and the structure of the business object the service expects. |
*.xsd | This file declares the XML schema for an object used in a service operation. Changes to the object, such as addition of a new parameter, require changes to this file. |
*_mapping.xml | This is the JAX-RPC mapping required by the WebSphere Application Server Web service engine. This file defines the Java representations of all the objects and operations specified in the WSDL description. Because the HCL Commerce Web service framework defines a single generic endpoint, this file maps the objects and operations to SOAP elements and delegates the execution to the single generic endpoint. |
webservices.xml | This file is used by the WebSphere Application Server Web service engine to map WSDL files to the appropriate JAX-RPC mapping files. This file also specifies the endpoint for delegating to for performing the services. Under the HCL Commerce Web service framework, the endpoint is always the single generic endpoint represented by the com.ibm.commerce.webservices.OpenWebServicePortType interface. However, for every new service defined, a new WSDL-to-JAX-RPC mapping must be added to this file. |
web.xml | This file is necessary for accepting Web service requests over HTTP. This file declares the servlets to be used for accepting and delegating Web service requests. This file should not require updates. |
ibm-webservices-ext.xmi | This WebSphere Web service extension file is used to specify security settings for Web services. It contains bindings between service names and either the port types or servlet names. |
ibm-webservices-bnd.xmi | This file maps Web services to the transport listeners found in the WebServicesRouter project. For new services, new mappings are required. |
The following is a summary of configuration changes associated with common Web service development tasks:
- Creating a new service requires creating a new WSDL file and a new JAX-RPC mapping file and updating the other files mentioned in the preceding table.
- Adding an operation to an existing service or modifying an existing operation requires changes to the appropriate WSDL and JAX-RPC mapping files.
- Adding a new parameter to an object used in a service operation requires updates to the object's XML schema file.