Utility Tools
CHAPTER 11
The WSDL Editor provides a quick and easy way to create, edit, and view WSDL documents. This chapter contains the following topics:
WSDL (Web Services Description Language) is a general-purpose XML vocabulary for describing Web Services. Using WSDL, it's possible to describe (concisely and in a standardized manner) the interface, protocol bindings, and deployment details of Web-based services, at a level of detail sufficient for businesses to begin interacting online.
For the complete WSDL standard, go to www.w3.org/TR/wsdl.
The WSDL Editor lets you:
Create and edit WSDL documents (files with the .wsdl extension)
Insert any of the four canonical WSDL document elements (message, port type, binding, or service)
The WSDL Editor is based on the XML Editor and its features, including:
The WSDL Editor also provides its own Stylized View tab for formatted display of WSDL documents.
To learn about using the basic editing features of the XML Source View and XML Tree View tabs, see XML Editors.
Complete the rest of the panel as needed:
(Optional) Enter a Target Namespace. This can be the Uniform Resource Name associated with this WSDL document. You cannot specify a relative URN.
(Optional) Enter a File Location. You can use the browse (...) button to select a target directory on your file system. If you don't specify a File Location, the new file will be saved to the root of your hard drive.
(Optional) In the Documentation text box, enter any human-readable comment or descriptive language you would like to associate with the definition element.
Check Include WSDL template if you want a skeleton document to be created for you using values provided in this wizard. Uncheck it to start with a blank document.
WSDL documents can contain four standard element types: message, port type, binding, and service. These element types build on one another with cascading references; so when you create a WSDL file, you should create the message section first, followed by the port type section, then the binding section, and finally the service section.
The WSDL Editor offers dialog-based assistance in creating each of the four types.
In WSDL, a message is an abstract definition of the data being exchanged.
To add a message element to a WSDL document:
In the XML Source View, position the insertion point where you want to insert the definition, then right-click.
Specify the following information in the Message dialog:
A WSDL port type is an abstract definition of the operations supported by a service and the communications mode (one-way, request-response, and so on) that will be used in the service.
To add a port type to a WSDL document:
In the XML Source View, position the insertion point where you want to insert the definition, then right-click.
Specify the following information on the Port Type dialog:
A WSDL binding specifies concrete protocol and data format specifications for the operations and messages defined by a particular port type.
To add a binding to a WSDL document:
In the XML Source View, position the insertion point where you want to insert the definition, then right-click.
Specify the following information on the Binding dialog:
Option |
What to do |
---|---|
Name |
Specify the value of the name attribute of the <binding> element. |
Documentation |
(Optional) Specify any human-readable comment or descriptive language you would like to associate with this binding element. |
Port Type |
Specify the port type for this binding. The dropdown list displays the names of the port types that you have created for this document (see Adding a port type element). |
SOAP Binding |
If your WSDL document will specify a SOAP binding, select SOAP Binding, then select a Style (RPC or Document) and specify a Transport value. |
HTTP Binding |
If an HTTP binding will be used, select HTTP Binding and enter the appropriate Verb (GET or POST). |
User Defined |
Select if you want to specify a custom binding protocol manually. |
A WSDL service names the entry-point address (or addresses) for the Web Service in question. These addresses are in the form of URIs and constitute ports.
To add a service to a WSDL document:
In the XML Source View, position the insertion point where you want to insert the definition, then right-click.
Specify the following information on the Service dialog:
Option |
What to do |
---|---|
Name |
Specify the value of the name attribute of the <service> element |
Documentation |
(Optional) Specify any human-readable comment or descriptive language you would like to associate with this service. |
Ports |
Specify this information for each <port> element of your service:
To add another port entry to the service, click Add.To remove an entry, select the entry and click Delete. |
When a WSDL document is displayed in the XML Source View, you can validate the document by clicking the Validate toolbar button (which looks like a check mark). If the document is validated, you see this dialog:
Otherwise, you see a dialog giving information identifying the malformed statement(s) in the document.
CAUTION: You should carefully review your WSDL even if the document validation is successful. The W3C WSDL specification allows for extensibility elements throughout all levels of a WSDL document. So if you build the document without using the dialogs or do a lot of cut-and-paste from other sources, it is possible that the document will test as valid but not be what you want.
For easier reading, you can display your WSDL document in the Stylized View, which applies an XSL style sheet to the document. The WSDL Editor comes with two built-in style sheets: Summary and Details.
To display a stylized view of a WSDL document:
Click the Stylized View tab at the bottom of the WSDL Edit Pane.
In this example, the Summary style sheet has been applied to the document.
To choose a different style for the stylized view:
With the Stylized View tab selected, right-click in the WSDL Edit Pane.
Select an item from the Stylesheets submenu:
Details provides a detail-oriented plain-text view of the WSDL document (with no XML tags)
Custom opens a dialog that allows you to choose your own XSL style sheet for rendering a custom view, and/or setting a default style sheet
TIP: You can optionally select the Set as default check box to apply the style sheet you've chosen as the default in stylized views. Your preference will persist across development environment sessions.
When you have created a WSDL document, you can publish it to a registry.
For more information, see Publishing to a registry.
A WSDL document describes a Web Service. You can invoke the Web Service Wizard from the WSDL Editor to generate the Java classes needed to implement or consume that Web Service.
For more information, see Web Service Wizard.
Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved. more ...