This section describes how to create and manage Web service clients from a Web service. Each procedure requires that you first:
Connect to the server that contains the Web service.
Expand the Web Services icon.
Expand the Web service collection to which the Web service belongs.
The
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:
When compiling the client class, do not include sybasewstrt.jar. Set the required JARs in the classpath individually.
The classpath should include at a minimum: sybasewstrt.jar, sybasewst.jar, jaxrpc.jar, and the path to the client artifacts.
When running the client, use either the “-classpath” option, or “set classpath” to specify the location of the required files identified by sybasewstrt.jar.
After using the wizard to generate the various files required by the client, see Chapter 7, “Developing Web Service Clients” for a description of how to develop a client.
Right-click the Web service and then select Create Web Service Client.
The Create Web Service Client wizard displays.
Follow the wizard instructions described in Table 4-4. Click Finish when done.
The wizard generates the test client, and necessary client artifacts in the package you specify.
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:
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. |
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.
Right-click the Web service and then select Create JSP client.
This procedure launches the JSP client you created in the proceeding procedure, by starting a Web browser, and running the JSP.
Right-click the Web service and then select Launch JSP Client.
If you created a JSP client for this Web service, this procedure deletes it.
Right-click the Web service and then select Delete JSP Client.