Chapter 3 Creating and Using WSDL Documents


Web services and WSDL documents

When you have created a WSDL document, you can associate a Web service with it, provided that the service has a signature that includes only datatypes Web Services Toolkit supports. You must add at least one address for your Web service and specify operations for it.

Your WSDL document is created in the Webservices\work\wsdl directory in the EAServer installation.

This section discusses:

Adding a Web service to a WSDL document

You can add multiple addresses to your Web service. This feature allows you to specify alternative locations from which the Web service can be accessed. At runtime, if the first address is unreachable, the client proxy will try each subsequent address until a connection is made or all addresses have been attempted. Each address must point to a Web service which has been installed.

Steps To add a Web service to a WSDL document

  1. Right-click the name of your WSDL document in the Details pane and select New Web Service.
  2. Add an EAServer package/component name in the Web Service Name box. You must enter a component that has supported datatypes.

    Or, click Browse. A list of components with supported datatypes appears in the Browse Services dialog box. Any components that use registered user-defined datatypes also appear.
  3. Enter a description of the service in the Description box in the New Web Service dialog box. (This information is optional.) Click OK to save your changes.

Adding, removing, and modifying an address to your Web service

Steps To add an address to your Web service

  1. Select the name of your WSDL document in the main pane of Sybase Central.
  2. Right-click the Web service name in the Name column of the Details pane and select Properties. The Web Service Properties dialog box opens.
  3. Click Add Addresses to display the Web Service Addresses dialog box.
  4. Enter values in the following boxes:

    Note   The default values for the WebApp Context and the URL Pattern are set in the webservices.props file in the Webservices directory in your EAServer installation. Sybase recommends using the defaults. If you change your Web application, update the webservices.props file to create new defaults.
  5. Click Add to create an address.
  6. Click OK to save your address.

    Repeat these steps if you want to add more addresses.

    To select operations for your new Web service, go to "Selecting operations for your Web service".

Steps To remove an address:

  1. Follow steps 1 through 3 in "Adding, removing, and modifying an address to your Web service".
  2. Select the name of the address you want to remove in the Current Addresses text field. Click Remove.
  3. Click OK in the Web Services Addresses dialog box. The Web Service Properties dialog box appears.
  4. Click OK in the Web Services Properties dialog box to save your changes.

Steps To modify an address

  1. Follow steps 1 through 3 in "Adding, removing, and modifying an address to your Web service".
  2. Select the address you want to modify in the Current Addresses list.
  3. Modify your Address property values.
  4. Click Update.
  5. Click OK in the Web Services Addresses dialog box. The Web Service Properties dialog box appears.
  6. Click OK in the Web Services Properties dialog box to save your changes.

Selecting operations for your Web service

Steps To select an operation for your Web service

  1. From the Web Service Properties dialog box, click the Select Operations button. The Select Service Operations dialog box opens.

    If the Web Service Properties dialog box is not already open, see steps 1 and 2 in "Adding, removing, and modifying an address to your Web service".
  2. Click the box in the Selected column to select operations for your Web service. These are the methods available in the EAServer component that you selected as a Web service. They are methods with datatypes Web Services Toolkit can serialize and deserialize. Any methods with registered user-defined datatypes that you created also appear.

    Click OK. The Web Service Properties dialog box appears.
  3. Click OK in the Web Services Properties dialog box to save your changes.

    To distribute your WSDL, go to Creating a SOAP Client Proxy.

Viewing the XML for your Web Service

Steps To view the XML of a Web service

  1. Select WSDL Documents in the main pane of Sybase Central.
  2. Right-click the Web service in the Definitions Name pane whose XML you want to view. Select Properties.
  3. Click the XML tab. The XML for your Web service appears.
  4. Click Cancel to return to Sybase Central.

 


Copyright © 2002 Sybase, Inc. All rights reserved.