Web services collection administration  Type mappings

Chapter 4: Web Services Administration

Web service administration

This section describes how to create Web services and add them to a Web service collection, and manage existing Web services. See “Exposing Components as Web services” for information about deploying existing components as Web services.


Creating Web services from files

This section describes how to:

The Web service can be contained in various projects. See “Web service projects” for more information about projects.

StepsCreating a Web service from a WSDL

  1. From the Web Service container, select File | New | Other.

  2. The New wizard displays. Select Sybase Web Services in the left pane, and Web Service in the right pane. Click Next. You can also create the Web service within a project by selecting Web Service Project. If you do not select a project at this time, you will be asked later to provide a project for the Web service.

  3. The Create Web Service wizard displays. Follow the instructions to create a Web service from a WSDL file. Table 4-3 describes the wizard properties.

  4. Complete the wizard instructions and click Finish to create the Web service. If you choose a Project for this Web service, you can view the project by selecting Window | Show View | Package Explorer. The Projects appear in the right pane. Expand the project and package to view the Web service. Along with a Web service, the wizard generates the other required files, including a .wsdd file.

    You can right-click the .wsdd file and then select Deploy to deploy it as a Web service.

StepsCreating a Web service from a Java file

  1. From the Web Service container, select File | New | Other.

  2. The New wizard displays. Select Sybase Web Services in the left pane, and Web Service in the right pane. Click Next. You can also create the Web service within a project by selecting Web Service Project. If you do not select a project at this time, you are asked later to provide a project for the Web service.

  3. The Create Web Service wizard displays. Follow the instructions to create a Web service from a Java file. Table 4-3 describes the wizard properties.

  4. Complete the wizard instructions and click Finish to create the Web service. If you choose a Project for this Web service, you can view the project by selecting Window | Show View | Package Explorer. The Projects appear in the right pane. Expand the project, and package to view the Web service. Along with a Web service, the wizard generates the other required files, including a .wsdd file.

    You can right-click the .wsdd file and then select Deploy to deploy it as a Web service.

Table 4-3: Web service creation wizard options and properties

Window

Property

Description

Select the Web Service Project

Project Type

Select the project in which you will create a Web service.

The project wizard displays only if you choose to create a Web service project.

Create the Project

Project Name

Provide a name for your project.

Project Contents

Use the Browse button to select the project contents directory that contains your project, or click the check box to use the default directory, which is the project name located in the $Eclipse/workspace directory.

Select Approach

Create from WSDL or Create from Java File

You can create the The Web service from an existing Java file or .wsdl file. Click the appropriate check box.

If Creating From WSDL

Locate From a Local File, URL, or UDDI

Provide the location of the .wsdl file, by entering the file location, URL, or UDDI site. If the file is on the local file system use Browse to locate it. If you are locating the file from a UDDI site, follow the instructions for publishing to a UDDI site as described in Table 4-8.

Package Name

The name of the package in which the Web service is created. If you do not enter a package name, “default” is used.

If Creating From Java File

Create From Java File

Enter the Java file being used to create the Web service.

Options

You can specify various preferences used for you Web service deployment. These options are described in Table 4-6.

Method Selection

Select the methods/operations to be exposed in the Web service’s WSDL file.

Summary

A summary of your entries. Verify they are accurate and click Finish, or Back to change your selections.


Web service projects

The WST development tool allows you to create and maintain various projects that contain collections of Web services, class files, readme files, and so on, that make up a Web service project depending on your need. For example, you can create:

Sybase recommends that when creating projects, you keep the client-side code in a client project and server-side code in a separate server project. This allows you to generate, compile, and maintain the client-side and server-side files, artifacts, and dependent classes independently.

To get an idea of how projects can be used to keep track of your various Web service projects, See “Creating the sample projects and installing the samples”.


Web service management

This section describes how to use the WST development tool to manage Web services already contained in a server. Each procedure described in this section 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.

StepsViewing the WSDL

  1. Right-click the Web service and then select View WSDL.

  2. The WSDL file for this Web service displays in the right pane. You cannot edit this file.

StepsActivating a Web service

If a Web service is already activated, this option is dimmed; clients can only access a Web service that is activated:

  1. Right-click the Web service and then select Activate.

StepsDeactivating a Web service

If a Web service is already deactivated, this option is dimmed.

  1. Right-click the Web service and then select Deactivate.

StepsRefreshing a Web service

Refresh a Web service if you make any changes to it.

  1. Right-click the Web service and then select Refresh.

StepsDeleting a Web service

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


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.


Web service operation management

This section describes how to manage Web service operations (or methods). These procedures require that you:

  1. Expand the Web service collection.

  2. Expand the Web service.

  3. Expand the operations folder.

Overloaded methods

If you deploy a Web service that contains overloaded methods, the WST development tool displays only the first method of the overloaded method. Allowing or disallowing access to the method, affects all overloaded methods.

For example, if the Web service contains an overloaded method that contains the methods echo(String, String) and echo (String), the GUI displays only echo (String, String) twice, but the allowed/disallowed operation affects both echo(String, String) and echo(String).

StepsInvoking an operation

This procedure invokes an operation of the Web service to which it belongs.

  1. Right-click the operation and then select Invoke.

StepsAllowing an operation

Allowing a Web service operation makes it available to clients. If a Web service operation is already allowed, this option is dimmed.

  1. Right-click the operation and then select Allow.

StepsDisallowing an operation

Prevent access to a Web service operation by following this procedure. If a Web service operation is already disallowed, this option is dimmed.

  1. Right-click the operation and then select Disallow.

Table 4-5 describes the Web service operation properties.

Table 4-5: Web service operation properties

Property type

Property

Description

General

Name

The name of the operation.

Description

A description of the Web service operation.

Style

The SOAP binding style:

  • Document – indicates that the SOAP body contains an XML document, or

  • RPC (remote procedure call) – indicates that the SOAP body contains an XML representation of a method/operation call.

Return Type

Specifies the return type of the operation.

Is return value in response message

True or false.

SOAP Action

The URI for the SOAPAction HTTP header for the HTTP binding of SOAP. The SOAPAction HTTP request header field can be used to indicate the intent of the SOAP HTTP request. The URI identifies the intent.

Message Operation Style

Document, RPC, or wrapped.





Copyright © 2005. Sybase Inc. All rights reserved. Type mappings