Creating a client application (Java Web services)

A client application sends requests to and receives responses from the Web services APIs. By using a proxy client to manage communications and helper classes to format complex data types, a client application can invoke Web service methods as if they were local functions.

Before you begin

Before starting to create a client application, generate the proxy client and any necessary helper classes.

Why and when to perform this task

You can develop client applications using any Web services-compatible development tool, for example IBM® Rational® Application Developer (RAD). You can build any type of Web services application to call the Web services APIs.

Steps for this task

  1. Create a new client application project.
  2. Generate the proxy client and add the Java™ helper classes to your project.
  3. Code your client application.
  4. Build the project.
  5. Run the client application.

Example

The following example shows how to use the Business Flow Manager Web service API.
// create the service locator and the proxy
       BFMWSServiceLocator  locator = new BFMWSServiceLocator();
       BFMIF proxy = locator.getBFMWSPort();
	
	// prepare the input data for the operation
      GetProcessTemplate iW = new GetProcessTemplate();
      iW.setIdentifier(your_process_template_name);
      
	// invoke the operation
      GetProcessTemplateResponse oW = proxy.getProcessTemplate(iW);

	// process output of the operation
      ProcessTemplateType ptd = oW.getProcessTemplate();
      System.out.println("getName= " + ptd.getName());
      System.out.println("getPtid= " + ptd.getPtid());     
Related tasks
Using WSDL2Java to generate a proxy client
Generating a proxy client (Java Web services)
Creating helper classes for BPEL processes (Java Web services)

(c) Copyright IBM Corporation 2005, 2006.
This information center is powered by Eclipse technology (http://www.eclipse.org)