# Editing WSDL files

Once you have created a WSDL file, you can edit it in the WSDL editor. You can also import WSDL files into the workbench and edit them in the WSDL editor.

To open a WSDL file in the WSDL editor, double-click it in the Navigator view or right-click it and click Open With > WSDL Editor.

> Adding a service
> The `service` element is a collection of related ports and specifies the location of the service.
> Adding a port to a service
> A port defines an individual endpoint by specifying a single address for a binding. The port contains a 'binding' attribute that references a binding and an address element that provides a specification for the endpoint.
> Setting a port type
> A port type is a named set of abstract operations and the abstract messages involved. Each operation refers to an input message and output messages. A port type is reference by a binding object. Each binding references exactly one port type. Since each port refers to exactly one binding, each port has exactly one port type.
> Setting a binding
> A binding is a top level WSDL object that provides a concrete specification regarding the transmission of messages to and from a web service. A binding references exactly one port type. The structure of a binding corresponds very closely to that of the port type. The binding contains extensibility elements (for example, soap, http, and mime) that specify protocol specific details. Each port within a service references exactly one binding.
> Adding an operation
> An operation names the operation and lists the expected inputs and outputs. The operation element may also contain a fault sub-element that describes any error data the operation may return.
> Adding a message
> Messages represent an abstract definition of the data being transmitted. A message consists of logical parts, each of which is associated with a definition within some type system. WSDL messages are top level objects that can be referenced by an operation's input, output and fault elements (within a port type).
> Adding a part to a message
> All messages contain one or more parts. Parts are a flexible mechanism for describing the logical abstract content of a message. The message definition associates each part with a type using a message-typing attribute.
> Creating an import statement
> The import statement is used to import other WSDL documents or XML schemas into your WSDL document. This enables you to have more modular WSDL documents. The use of the import statement allows the separation of the different elements of a service definition into independent documents, which can then be imported as needed. This technique helps in writing clearer service definitions, by separating the definitions according to their level of abstraction.
> Creating a new type for your WSDL file
> Types describe all the data types used between the client and server. WSDL is not tied exclusively to a specific typing system, but it uses the W3C XML Schema specification as its default choice.

Parent topic: Editing WSDL files with the WSDL Editor

## Editing in the Source view

To edit a WSDL file in the Source view, follow these steps:

1. Open your WSDL file in the WSDL editor.
2. Click the Source tab.
3. Select the source code you want to edit.

At any time, you can switch to the Source view to review the source for the WSDL file. You can also edit your WSDL file directly in the Source view.

## Editing in the Graph view

The Graph view provides a graphical way to browse and edit your WSDL file. Each type of top level wsdl object is shown within a group (e.g. service, port type, message). Within each group is a tree view that can be used to browse the structure of the object. The service, binding, port type and message groups are 'linked'. If for example we select an input in the port types, we'll notice that the message that is referenced by this message is scrolled into view in the messages group. A line displays to denote a reference (or association) between these objects.

## Showing Bindings in the Graph view

By default bindings are shown in the Graph View. Select the show/hide binding button at the top left of the Graph View to hide the bindings. With the bindings hidden a service can be browsed from a purely abstract level without showing binding information. When the need arises to understand the concrete details represented by the binding, select the show/hide binding button again to make them visible.

## Editing in the Outline view

The Outline view will show you all the items in your WSDL file as you add them. In this view, you can both create and delete WSDL components.

The Outline view contains the following folders you can use (by right-clicking and selecting the appropriate option) to edit your WSDL file:

- Imports statements, which are used to associate a namespace with a document location.
- Types, which provide data type definitions used to describe the messages exchanged. You cannot edit any types directly using this folder.
- Messages, which represent an abstract definition of the data being transmitted. A message consists of logical parts, each of which is associated with a definition within some type system.
- Port Types, which are a set of abstract operations. Each operation refers to an input message and output messages.
- Bindings, which specify concrete protocol and data format specifications for the operations and messages defined by a particular port type.
- Services, which are used to aggregate a set of related ports

Related tasks
Creating a new WSDL file
Importing a WSDL file

(C) Copyright IBM Corporation 1999, 2005. All Rights Reserved.