Develop and deploying Web services clients

 

+

Search Tips   |   Advanced Search

 

Overview

Web services clients can be developed based on the Web Services for J2EE specification and the Java API for XML-based remote procedure call (JAX-RPC) specification. There are two types of basic JAX-RPC Web services clients.

For a Java application to act as a Web service client, a mapping between the WSDL file and the Java application must exist. The mapping is defined by the JAX-RPC specification.

You can use a Java component to implement a Web service by specifying the component interface and binding information in the WSDL file and designing the appserver infrastructure to accept the service request. This entire process is based on the Web Services for J2EE specification. The JAX-RPC specification defines the mapping between a WSDL file, Java code and XML Schema types.

 

Procedure

  1. Obtain the SDL document for the Web service to access.

    You can locate the WSDL from the services provider through e-mail, through a URL or by looking it up in a UDDI registry.

  2. Develop client bindings from a WSDL file.

    The WSDL2Java command-line tool is run against your WSDL file to develop client bindings.

    The information needed to invoke the Web service is generated, including the service endpoint interface and implementations, the generated service interface and the ibm-webservicesclient-bnd.xmi and ibm-webservicesclient-ext.xmi deployment descriptors.

  3. Complete the client implementation.

    Write your client application code that is used to invoke the Web service.

    See Chapter 4 of the JSR 109 specification. You can access the specification through Web services: Resources for learning.

    If an application creates a number of threads in the JSR 109 client, the meta data (including the WAS configuration) is not copied to the thread, and the Global Security Handler is not called.

    You can also review the GetQuote client in the WebServicesSamples application available in the Samples Gallery.

  4. (Optional) Assemble a Web services-enabled client JAR file into an EAR file. Complete this step if you are developing a managed client that runs in the J2EE client container.

  5. (Optional) Assemble a Web services-enabled client WAR file into an enterprise archive (EAR) file. Complete this step if you are developing a managed client that runs in the J2EE client container.

  6. (Optional) Configure the client deployment descriptor . Complete this step if you are developing a managed client that runs in the J2EE client container.

  7. (Optional) Deploy the Web services client application. Complete this step to deploy a managed client that runs in the J2EE client container.

  8. Test the Web services-enabled client application. You can test an unmanaged client JAR file or a managed client application.

 

Results

You have created and tested a Web services client application.

 

What to do next

After you develop a Web services application client, and the client is statically bound, the service endpoint used by the implementation is the one that is identified in the WSDL file that you used during the development process. During or after installation of the Web services application, you might want to change the service endpoint. You can change the endpoint with the console or the wsadmin scripting tool.

 

See also

  1. Developing client bindings from a WSDL file for a JAX-RPC client
  2. Change SOAP message encoding to support WSI-Basic Profile
  3. Configure the JAX-RPC Web services client deployment descriptor with an assembly tool
  4. Configure the JAX-RPC client deployment descriptor for handler classes
  5. Assembling a Web services-enabled client JAR file into an EAR file
  6. Assembling a Web services-enabled client WAR file into an EAR file
  7. Deploying a Web services client application
  8. Testing Web services-enabled clients
  9. Implementing extensions to the JAX-RPC and Web Services for J2EE client programming models

 

Related concepts

Web services

 

Related tasks

Setting up a development environment for Web services
Task overview: Implementing Web services applications

 

Related Reference

Web services client to Web container optimized communication
Artifacts used to develop Web services
Web services enabled module - deployment descriptor settings (ibm-webservices-bnd.xmi file)
Web services specifications and APIs