Creating and managing Web service clients

This section describes how to create and manage Web service clients from a Web service. Each procedure requires that you first:

  1. Connect to the server that contains the Web service.

  2. Expand the Web Services icon.

  3. Expand the Web service collection to which the Web service belongs.

NoteThe wizards described in this section generate a test client runtime JAR file, sybasewstrt.jar, which contains one file, manifest.mf, that lists the JAR files required by the runtime client:

After using the wizard to generate the various files required by the client, see Chapter 9, “Developing Web Service Clients” for a description of how to develop a client.

StepsCreating a Web service client

  1. Right-click the Web service and then select Create Web Service Client.

  2. The Create Web Service Client wizard displays.

  3. Follow the wizard instructions described in Table 4-4. Click Finish when done.

  4. The wizard generates the test client, and necessary client artifacts in the package you specify.

Table 4-4: Create Web service client wizard options and properties

Window

Property

Description

Select a Project

Project Name

The wizard displays a list of available projects. Highlight the project to which the client you are generating belongs.

Java Package

Package

The name of the package where the client is generated. Enter a name of a package, or use the drop down list to locate an existing package.

WSDL2Java Options

Generate Code for this WSDL Only

Select this checkbox to generate code only for this WSDL document. Uncheck (The default) to generate files for all WSDL documents, the immediate one and all imported ones.

Timeout

The time, in seconds, for this operation to complete successfully before timing out. In case of timeout, check the log files for possible reasons.

Use Special Treatment for “wrapped” Document/Literal

Allows support for “wrapped” document/literal. Wrapped is a document literal variation, that wraps parameters as children of the root element.

Uncheck this box to turn off the special treatment of “wrapped” document/literal style operations.

If checked (the default), WSDL2Java recognizes these conditions:

  • An input message has is a single part

  • The part is an element

  • The element has the same name as the operation

  • The element’s complex type has no attributes

Under these conditions, the top level elements are “unwrapped”, and each component of the element is treated as an argument to the operation. This type of WSDL is the default for Microsoft .NET Web services, which wraps RPC style arguments in this top level schema element.

Type Mapping Version

The type mapping version. Valid options are 1.1 (the default) and 1.2. This option determines which version of SOAP the Web service uses, SOAP 1.1 or SOAP 1.2.

Generate Code for All Elements

Allows you to generate and compile the stubs, wsdd, and ImplTemplate files.

Emit separate helper classes for meta data

Helper classes are used by the primary class to help execute its business methods/operations.

Helper classes are normally generated for user defined type beans. You can think of them as wrappers for the user defined beans that contain information (utility methods) which is used at runtime.They allow you to write your own Java beans with custom behavior and use them in the runtime SOAP stack.

User name

The user name used to access the WSDL URI.

Password

The password required by the user to access the WSDL URI.

Summary

Contains information from the previous pages. Review and click Finish to accept your selections, or Back to change.

StepsCreating a JSP client

This procedure generates JSP client pages from the Web service and stores them on the server. Once created, you can test the JSP pages by Launching the JSP client.

  1. Right-click the Web service and then select Create JSP client.

StepsLaunching a JSP client

This procedure launches the JSP client you created in the proceeding procedure, by starting a Web browser, and running the JSP.

  1. Right-click the Web service and then select Launch JSP Client.

StepsDeleting a JSP client

If you created a JSP client for this Web service, this procedure deletes it.

  1. Right-click the Web service and then select Delete JSP Client.