Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

WSDL Documents

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

<

types

data 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

The element is the most important WSDL element.

It can describe a web service, the operations that can be performed, and the related messages.

The element can be compared to a function library (or a module, or a class) in a traditional programming language.


WSDL messages

The element defines the data elements of an operation.

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

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

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

portType

In this example, The element defines "glossaryTerms" as the name of aportand "getTerm" as the name of aOperation.

The "getTerm" operation has an input message named "getTermRequest"input messageand an output message named "getTermResponse"output message.

The element can define thepartsof each message, and the associated data types.

Compared with traditional programming, glossaryTerms is a function library, and "getTerm" is a function with the input parameter "getTermRequest" and the return parameter getTermResponse.