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

WSDL ports

WSDL ports


The element is the most important WSDL element.


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.


Operation types

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

Type define
One-way This operation can accept a message but does not return a response.
Request-response This operation can accept a request and will return a response
Solicit-response This operation can send a request and will wait for a response.
Notification This operation can send a message but does not wait for a response.

One-Way operation

An example of a one-way operation:

Example

<

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" defines a one-way operation named "setTerm".

The "setTerm" operation accepts new glossary term item messages as input, using a message named "newTermValues" with the input parameters "term" and "value". However, no output is defined for this operation.


Request-Response operation

An example of 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" defines a request-response operation named "getTerm".

The "getTerm" operation requests an input message named "getTermRequest" with a parameter named "term", and returns an output message named "getTermResponse" with a parameter named "value".