WSDL document
WSDL document is just a simple XML document.
It contains a series of defined description of a web service.
WSDL document structure
WSDL document using these major elements to describe a web service is:
元素 | 定义 |
---|---|
<portType> | web service 执行的操作 |
<message> | web service 使用的消息 |
<types> | web service 使用的数据类型 |
<binding> | web service 使用的通信协议 |
One of the main structure of a WSDL document looks like this:
<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>
WSDL document may contain other elements, such as extension elements and a service element, which can hold a number of web services defined combination in a single WSDL document.
WSDL port
<portType> element is the most important WSDL element.
It can be described as a service, the operation can be performed, and the messages that web.
Can <portType> element can be compared in a traditional programming language function library (or a module, or a class).
WSDL message
<message> element defines the data elements of an operation.
Each message consists of one or more components. The parts can be compared to the parameters of a traditional programming language function calls.
WSDL types
<types> element defines the data types used by web service.
To maximize platform neutrality, WSDL using XML Schema syntax to define data types.
WSDL Bindings
<binding> element to define each port message format and protocol details.
WSDL instances
This is a simplified fraction of a WSDL document:
<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 to "glossaryTerms" is defined as the name of a port, the "getTerm" is defined as the name of an operation.
Operation "getTerm" has an input message called "getTermRequest", and the output message called "getTermResponse" of.
<message> element defines the components of each message, and the data associated with the type.
Compared to traditional programming, glossaryTerms is a function library, "getTerm" is "getTermRequest" a function with input parameters and return parameters of getTermResponse.