Client library for WebSphere Commerce services

+

Search Tips   |   Advanced Search

The client library's primary purpose is to simplify and eliminate code on the client. The client library is Java layer to help Java applications integrate with the service architecture, with no additional code generation required. The client library has support for session and authentication and provides Java-based clients a standardized mechanism to create the OAGIS SDO objects to represent service requests.

Each component will provide a client library project to access the component. The client project contains the following:

The subclass of the abstract client library class is a programmer friendly and Web enablement client library class. The programmer friendly client provides finer grain methods to perform specific service actions. These fine grain methods build up the appropriate service request SDO and call the methods offered by the abstract client library class to perform the service request. The programmer friendly library should only build up the service request object. It must not send the message or contain any additional business logic. The responsibility of sending is part of the abstract client library class and the additional business logic is the responsibility of the business task command using the client library.

An example of these Web enablement methods is seen in the following code:

//
==============================================================================
        // Programmer friendly APIs that can be used by clients to
perform 
        // more specific operations.  These APIs are a convenient
way to perform
        // common operations that clients of the SubsystemGroupName
facade would perform.
        //
==============================================================================

        protected NounNameType buildNounName(java.util.Map
parameters) {
                NounNameType nounName =
SubsytemGroupNameFactory.eINSTANCE.createNounNameType();
                String[] description = (String[])
parameters.get("description");
                if (description != null) {
                        nounName.setDescription(description[0]);
                }
                return nounName;
        }
        
        protected java.util.Map
buildResponse(AcknowledgeNounNameDataAreaType dataArea) {
                java.util.Map result = new java.util.HashMap();
                // populate response map ...
                return result;
        }
        
        public java.util.Map registerNounName(java.util.Map
parameters) throws NounNameException {
                AcknowledgeNounNameType ack =
super.processNounName(createProcessNounName("Register",
buildNounName(parameters)));
                AcknowledgeNounNameDataAreaType dataArea =
checkAcknowledgeNounName(ack.getDataArea());
                return buildResponse(dataArea);
        }

Protocol authentication is used between the client and the server. This means that the transport contains identity information which will be converted into the WebSphere Commerce identity on the server. Although the business context information will be contained in the request document, the identity will not be part of the document. Security information is only carried in the SOAP header.

The basic authentication credentials will be found in the SOAP header or transport properties and WebSphere will resolve them to the appropriate identity.

 

Related concepts

Client library authentication mechanisms
WebSphere Commerce services
WebSphere Commerce service module
Service Data Objects (SDO)
Component facade interfaces

 

Related tasks

Use a client library
Create the client library
Deploying the client library

 

Related reference

Client library exceptions
6.0.0.2 Order component client library