The Program Adapter allows external systems to communicate with WebSphere Commerce by passing XML requests over the HTTP protocol. The Program Adapter provides external systems such as procurement systems with a common way to communicate with WebSphere Commerce through HTTP, allowing WebSphere Commerce to act as a supplier to these systems, for buyer/supplier transactions. The Program Adapter handles incoming XML requests by performing the following actions:
- Recognizing the request and verifying if it is an XML request. If the
following three attributes of the request are supported, it can be
distinguished it as an XML request.
- content-type
- method
- character encoding
The supported request attributes are specified in the adapter configuration.
- Extracting the input stream of the request.
- Calling the message mapper and passing the content of the input stream.
- Receiving the CommandProperty object representing a WebSphere Commerce command returned by the message mapper.
- Determining the proper device format in which to generate the response.
- Executing the command.
- Sending an XML response message, created by a JSP and based on the viewname specified by the command executed and the device format of the received request.
Each request is treated as a separate session. The credentials of the message are specified in the control area of the message. By default, the Program Adapter checks the user ID and password parameters to determine the authenticity of a request. The Program Adapter does not support legacy messages because legacy messages do not support the specification of credentials.
The lifecycle of the Program Adapter exists throughout the WebSphere Commerce instance. It is initialized when an instance is started unless its configuration parameters are removed or the adapter is not enabled, and it resides as long as the instance runs.
For architectural information on how WebSphere Commerce handles receiving requests from devices, refer to the WebSphere Commerce Programming Guide and Tutorials.