WSDL Documents
A WSDL document is simply an XML document.
It contains a set of definitions that describe a web service.
WSDL document structure
A WSDL document uses these main elements to describe a web service:
| Element | define |
|---|---|
| The operations performed by the web service | |
| The messages used by the web service | |
| The data types used by the web service | |
| The communication protocols used by the web service |
The main structure of a WSDL document looks like this:
WSDL document example
<
definitions
<
typesdata type definitions........
types
<
message
definition of the data being communicated....
message
<
portType
set of operations......
portType
<
binding
protocol and data format specification....
binding
definitions
A WSDL document can contain other elements, such as an extension element and a service element, which can combine the definitions of several web services in a single WSDL document.
WSDL ports
It can describe a web service, the operations that can be performed, and the related messages.
The
WSDL messages
Each message consists of one or more parts. These parts can be compared to the parameters of a function call in a traditional programming language.
WSDL types
For maximum platform neutrality, WSDL uses XML Schema syntax to define data types.
WSDL Bindings
WSDL example
This is a simplified fragment of a WSDL document:
Example
<
message
name
=
"
getTermRequest
"
<
part
name
=
"
term
"
type
=
"
xs:string
"
/>
message
<
message
name
=
"
getTermResponse
"
<
part
name
=
"
value
"
type
=
"
xs:string
"
/>
message
<
portType
name
=
"
glossaryTerms
"
<
operation
name
=
"
getTerm
"
<
input
message
=
"
getTermRequest
"
/>
<
output
message
=
"
getTermResponse
"
/>
operation
portTypeIn this example,
The "getTerm" operation has an input message named "getTermRequest"input messageand an output message named "getTermResponse"output message.
Compared with traditional programming, glossaryTerms is a function library, and "getTerm" is a function with the input parameter "getTermRequest" and the return parameter getTermResponse.