Wsdl Documents
# WSDL Document
* * *
A WSDL document is simply an XML document.
It contains a set of definitions describing a web service.
* * *
## WSDL Document Structure
A WSDL document uses the following major elements to describe a web service:
| Element | Definition |
| --- | --- |
| | Operations performed by the web service |
| | Messages used by the web service |
| | Data types used by the web service |
| | Communication protocols used by the web service |
The main structure of a WSDL document looks like this:
## WSDL Document Example
data type definitions........ definition of the data being communicated.... set of operations...... protocol and data format specification....
A WSDL document can contain other elements, like extension elements, and a service element, which can combine the definitions of several web services into a single WSDL document.
* * *
## WSDL Ports
The __ element is the most important WSDL element.
It describes a web service, the operations that can be performed, and the associated messages.
You can think of the element as a function library (or a module, or a class) in a traditional programming language.
* * *
## WSDL Messages
The __ element defines the data elements for an operation.
Each message consists of one or more parts. You can think of these parts as the parameters of a function call in a traditional programming language.
* * *
## WSDL Types
The __ element defines the data types used by the web service.
For maximum platform neutrality, WSDL uses XML Schema syntax to define data types.
* * *
## WSDL Bindings
The __ element defines the message format and protocol details for each port.
* * *
## WSDL Example
Here is a simplified fragment of a WSDL document:
## Example
In this example, the __ element defines "glossaryTerms" as the name of a _port_, and "getTerm" as the name of an _operation_.
The "getTerm" operation has an _input message_ called "getTermRequest" and an _output message_ called "getTermResponse".
The __ element defines the _parts_ of each message, as well as the associated data types.
Compared to traditional programming, glossaryTerms is a function library, and "getTerm" is a function with an input parameter "getTermRequest" and a return parameter getTermResponse.
YouTip