Latest web development tutorials

WSDL port

<portType> element is the most important WSDL element.


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).


Action Type

Request - response is the most common operation type, but WSDL defines four types:

类型 定义
One-way 此操作可接受消息,但不会返回响应。
Request-response 此操作可接受一个请求并会返回一个响应
Solicit-response 此操作可发送一个请求,并会等待一个响应。
Notification 此操作可发送一条消息,但不会等待响应。


One-Way Operation

A one-way operation examples:

<message name="newTermValues">
<part name="term" type="xs:string"/>
<part name="value" type="xs:string"/>
</message>

<portType name="glossaryTerms">
<operation name="setTerm">
<input name="newTerm" message="newTermValues"/>
</operation>
</portType >

In this example, the port "glossaryTerms" define a group called "setTerm" a one-way operation.

This "setTerm" Operation acceptable new glossary item input message, these messages using a message called "newTermValues" This message with input parameter "term" and "value". However, it does not define any output for this operation.


Request-Response operation

A request-response operation 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 port "glossaryTerms" define a group called "getTerm" the request-response operation.

"GetTerm" action request input message called "getTermRequest" This message has a parameter called "term" and will return an output message called "getTermResponse" This message with a " value "parameter.