Utility Tools

CHAPTER 11

WSDL Editor

The WSDL Editor provides a quick and easy way to create, edit, and view WSDL documents. This chapter contains the following topics:

 
Top of page

About WSDL

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 more information    For the complete WSDL standard, go to www.w3.org/TR/wsdl.

 
Top of page

About the WSDL Editor

The WSDL Editor lets you:

 
Top of section

Editor features

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.

WSDLIntro

For more information    To learn about using the basic editing features of the XML Source View and XML Tree View tabs, see XML Editors.

 
Top of page

Creating a WSDL document

Procedure To create a WSDL document:

  1. Select File>New>File.

  2. On the Web Services tab, select WSDL and click OK.

    The WSDL Wizard displays.

    WSDLWizard

  3. Enter a Definition Name.

  4. Complete the rest of the panel as needed:

  5. Click Finish.

    A new WSDL document opens in the WSDL Editor.

    WSDLTextScreen

 
Top of page

Adding elements to a WSDL 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.

 
Top of section

Adding a message element

In WSDL, a message is an abstract definition of the data being exchanged.

Procedure To add a message element to a WSDL document:

  1. In the XML Source View, position the insertion point where you want to insert the definition, then right-click.

    A popup menu displays.

  2. Select Insert WSDL Element>Message.

    WSDLInsertMessage

  3. Specify the following information in the Message dialog:

    Option

    What to do

    Name

    Specify the value of the name attribute of the <message> element.

    Documentation

    (Optional) Specify any human-readable comment or descriptive language you would like to associate with this message.

    Parts

    Specify this information for each <part> element of your message:

    • The name attribute

    • The typing value (Element or Type)

    • Under Value, the element attribute

    To add another part entry to the message, click Add. To remove an entry, select the entry and click Delete.

  4. Click OK.

    A new message section is added to your document.

 
Top of section

Adding a port type element

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.

Procedure To add a port type to a WSDL document:

  1. In the XML Source View, position the insertion point where you want to insert the definition, then right-click.

    A popup menu displays.

  2. Select Insert WSDL Element>Port Type.

    WSDLInsertPortType

  3. Specify the following information on the Port Type dialog:

    Option

    What to do

    Name

    Specify the value of the name attribute of the <portType> element.

    Documentation

    (Optional) Specify any human-readable comment or descriptive language you would like to associate with this port type.

    Operations

    Specify this information for each <operation> element of your port type:

    • The name attribute

    • The type (One-way, Request-response, Solicit-response, or Notification)

    • Under Formats, click the Define button to specify the operation's messages using the Define dialog

      The dialog has several control groups. Only those that are appropriate to the type of operation are enabled. For example, if you chose Notification as the type, only the Output control group is enabled. For each enabled group, you must specify a Name and Message appropriate to the operation for Input and Output. Specifying values for the Fault group is optional.

    To add another operation entry to the port type, click Add.To remove an entry, select the entry and click Delete.

  4. Click OK.

    A new port type section is added to your document.

 
Top of section

Adding a binding element

A WSDL binding specifies concrete protocol and data format specifications for the operations and messages defined by a particular port type.

Procedure To add a binding to a WSDL document:

  1. In the XML Source View, position the insertion point where you want to insert the definition, then right-click.

    A popup menu displays.

  2. Select Insert WSDL Element>Binding.

    WSDLInsertBinding

  3. 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.

  4. Click OK.

    A new binding section is added to your document.

 
Top of section

Adding a service element

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.

Procedure To add a service to a WSDL document:

  1. In the XML Source View, position the insertion point where you want to insert the definition, then right-click.

    A popup menu displays.

  2. Select Insert WSDL Element>Service.

    WSDLInsertService

  3. 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:

    • The name attribute

    • The binding value; the dropdown list displays the names of the bindings you have created for this document (see Adding a binding element)

    • The address type (None, SOAP, or HTTP)

    • The location (the URI by which your service will be available)

    To add another port entry to the service, click Add.To remove an entry, select the entry and click Delete.

  4. Click OK.

    A new service entry is added to your document.

 
Top of page

Validating a WSDL document

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:

DocIsValid

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.

 
Top of page

Displaying a stylized view

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.

Procedure To display a stylized view of a WSDL document:

  1. Open the WSDL document.

  2. Click the Stylized View tab at the bottom of the WSDL Edit Pane.

    The view changes to stylized.

    WSDLSummaryStyledView

    In this example, the Summary style sheet has been applied to the document.

Procedure To choose a different style for the stylized view:

  1. With the Stylized View tab selected, right-click in the WSDL Edit Pane.

    A popup menu displays.

  2. Select an item from the Stylesheets submenu:

 
Top of page

Publishing to a registry

When you have created a WSDL document, you can publish it to a registry.

For more information    For more information, see Publishing to a registry.

 
Top of page

Generating Web Service files from WSDL

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.

Procedure To generate Java classes:

  1. Make sure a project is open.

  2. Open the WSDL document in the XML Source View.

  3. Click the Generate Java Class button.

    GenJavaClass

    The Web Service Wizard is invoked.

For more information    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 ...