WSDL Documentation
- Previous Page WSDL Introduction
- Next Page WSDL Port
A WSDL document is simply an XML document.
It contains a series of definitions that describe a web service.
WSDL Document Structure
A WSDL document describes a web service using these main elements:
Element | Definition |
---|---|
<portType> | Operations executed by the web service |
<message> | Messages used by the web service |
<types> | Data types used by the web service |
<binding> | Communication protocol used by the web service |
The main structure of a WSDL document is similar to this:
<definitions> <types> definition of types........ </types> <message> definition of a message.... </message> <portType> definition of a port....... </portType> <binding> definition of a binding.... </binding> </definitions>
A WSDL document can include other elements, such as extension elements, and a service element that can combine the definitions of several web services into a single WSDL document.
For a complete syntax overview, please visit WSDL Syntax This section.
WSDL Port
<portType> The element is the most important WSDL element.
It can describe a web service, executable operations, and related messages.
The <portType> element can be likened to a library (or a module, or a class) in traditional programming languages.
WSDL Messages
<message> The element defines the data elements of an operation.
Each message is composed of one or more parts. These parts can be likened to the parameters of a function call in traditional programming languages.
WSDL types
<types> The element defines the data types used by the web service.
To achieve maximum platform neutrality, WSDL uses XML Schema syntax to define data types.
WSDL Bindings
<binding> The element defines the message format and protocol details for each port.
WSDL Instance
This is a simplified fragment of a WSDL document:
<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,<portType> Element defining "glossaryTerms" as a certainPortname, defining "getTerm" as a certainOperationname.
The operation "getTerm" has a named "getTermRequest"Input message, and a named "getTermResponse"Output message.
<message> An element can define each message'sComponent, as well as related data types.
Compared to traditional programming, glossaryTerms is a library, and "getTerm" is a function with input parameter "getTermRequest" and return parameter getTermResponse.
- Previous Page WSDL Introduction
- Next Page WSDL Port