Tutorial: Creating an outbound web service client

In this tutorial, you create the MyCompanyMember outbound web service client. This client integrates WebSphere Commerce with a sample web service which manages users. The MyCompanyMember web service client integrates with the UserRegistrationAdd and UserRegistrationUpdate commands to push new and updated user registration information to the sample system.

The sample web service that is called by the client consists of a PushUser message that contains user registration information and a PushUserConfirmation response that contains confirmation of the request.

Service Data Objects (SDO) are used by the MyCompanyMember client to build the PushUser request message. These objects are used to handle the PushUserConfirmation response that is generated from the sample system.

The tutorial results are tested by registering a new user in you store and viewing the request and response message. These messages are sent between WebSphere Commerce and the sample user web service.

Attention: When you use Rational Application Developer to generate the Java artifacts, by default EMF 2.4 is chosen. To work with WebSphere Commerce Version 7, you must explicitly select EMF 2.2 while you generate the Java artifacts. For more information, see Setting an EMF genmodel to generate 2.2 compatible objects.
Important: The following implications must be considered when you are completing this tutorial:
  • This tutorial uses the WebSphere Commerce HTTP-WS adapter, while web service clients can be developed by using the WebSphere Commerce adapters or through a JAX-WS/JAX-RPC client.
  • Transport Layer Security is the only level of security that can be enabled for the web services that are created in this tutorial. For more information, see Enabling SSL for outbound web services.
  • If you require more security measures, consider alternatives such as creating JAX-WS/JAX-RPC web service clients by using the Rational Application Developer wizard.
    Note: If you are using the Rational Application Developer wizard, the client can be created under an EJB project by using a stateless session bean facade to access the service, not in the Stores.war project. That is, if you define the web service client in the stores web module, the service reference is not visible if you are running outside the Stores context. For example, if you attempt to use the web Service Client from a scheduler job, the call fails.

The following diagram illustrates:

  1. The integration of the MyCompanyMember client API with the WebSphere Commerce user registration commands.
  2. The integration of the MyCompanyMember client API with the WebSphere Commerce messaging system.
  3. The consumption of the MyCompanyMemberServices web service by WebSphere Commerce.

Learning objectives

After you complete this tutorial, you should be familiar with the following concepts:
  • Web services
  • XML schema
After completed this tutorial, you should be able to complete the following tasks:
  • Create an outbound web service client
  • Integrate an outbound web service with a sample web service which manages users.

Time required

Expect this tutorial to take about 4 hours to complete. This tutorial can take longer if you explore concepts that are related to this tutorial.

This tutorial is intended for WebSphere Commerce developers who are responsible for integrating WebSphere Commerce with an external system.

To complete this tutorial, ensure that you are familiar with the following terms and concepts:
  • Web services
  • WebSphere Commerce Developer
  • An understanding of the Java programming language.
  • A basic understanding of the database type that is used in your WebSphere Commerce development environment.
  • A basic understanding of access beans.
  • A basic understanding of XML.

System requirements

Before you begin this tutorial, ensure that you complete the following tasks:
  • Installed WebSphere Commerce Developer Version 7.