Tutorial: Creating an outbound web service client
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.
- 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:
- The integration of the MyCompanyMember client API with the WebSphere Commerce user registration commands.
- The integration of the MyCompanyMember client API with the WebSphere Commerce messaging system.
- The consumption of the MyCompanyMemberServices web service by WebSphere Commerce.
Learning objectives
- Web services
- XML schema
- 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.
- 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
- Installed WebSphere Commerce Developer Version 7.