
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.
To add a Web service to a WSDL document
- Right-click the name of your WSDL document
in the Details pane and select New Web Service.
- 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.
- 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
To add an address to your Web service
- Select the name of your WSDL document in
the main pane of Sybase Central.
- Right-click the Web service name in the Name column
of the Details pane and select Properties. The Web Service Properties
dialog box opens.
- Click Add Addresses to display the Web Service
Addresses dialog box.
- Enter values in the following boxes:
- Protocol - select HTTP or HTTPS.
- Port - specify the port through which your
Web service is accessed.
- Host - specify the host through which your
Web service is accessed.
- WebApp Context: WEBSERVICE - the default
name that represents the path to the Web Services Web application.
- URL Pattern: SOAP - the resource indicator
within the Web Application. For Web Services Toolkit, it points
to the SOAP Servlet. For more information see Web Applications in
the EAServer documentation.
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.
- Click Add to create an address.
- 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".
To remove an address:
- Follow steps 1 through 3 in "Adding, removing, and modifying
an address to your Web service".
- Select the name of the address you want to remove
in the Current Addresses text field. Click Remove.
- Click OK in the Web Services Addresses dialog
box. The Web Service Properties dialog box appears.
- Click OK in the Web Services Properties dialog
box to save your changes.
To modify an address
- Follow steps 1 through 3 in "Adding, removing, and modifying
an address to your Web service".
- Select the address you want to modify in the Current
Addresses list.
- Modify your Address property values.
- Click Update.
- Click OK in the Web Services Addresses dialog
box. The Web Service Properties dialog box appears.
- Click OK in the Web Services Properties dialog
box to save your changes.
Selecting operations for your Web service
To select an operation for your Web service
- 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".
- 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.
- 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
To view the XML of a Web service
- Select WSDL Documents in the main pane
of Sybase Central.
- Right-click the Web service in the Definitions
Name pane whose XML you want to view. Select Properties.
- Click the XML tab. The XML for your Web service
appears.
- Click Cancel to return to Sybase Central.
Copyright © 2002 Sybase, Inc. All rights reserved.
|
|