当前位置: 首页 > 网络学院 > XML相关教程 > WSDL > WSDL 端口

WSDL
WSDL 介绍
WSDL 文档
WSDL 端口
WSDL 绑定
WSDL 与 UDDI
WSDL 语法
WSDL 摘要

WSDL 端口


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 579 ::
收藏到网摘: n/a

A WSDL port describes the interfaces (legal operations) exposed by a web service.
WSDL 端口描述了由某个 Web service 所提供的交互界面(合法操作)。


WSDL Ports
WSDL 端口

The <portType> element is the most important WSDL element.
<portType>元素是最重要的WSDL元素。

It defines a web service, the operations that can be performed, and the messages that are involved.
它定义了一个Web服务,可执行的操作以及所涉及的信息

The port defines the connection point to a web service. It can be compared to a function library (or a module, or a class) in a traditional programming language. Each operation can be compared to a function in a traditional programming language.
端口定义了指向某个 web service 的连接点。可以把它元素比作传统编程语言中的一个函数库(或一个模块、或一个类),而把每个操作比作传统编程语言中的一个函数。


Operation Types
操作类型

The request-response type is the most common operation type, but WSDL defines four types:
请求-响应是最普通的操作类型,不过 WSDL 定义了四种类型:

Type
类型
Definition
定义
One-way The operation can receive a message but will not return a response
此操作可接受消息,但不会返回响应
Request-response The operation can receive a request and will return a response
此操作可接受一个请求并会返回一个响应
Solicit-response The operation can send a request and will wait for a response
此操作可发送一个请求,并会等待一个响应
Notification The operation can send a message but will not wait for a response
此操作可发送一条消息,但不会等待响应

 


One-Way Operation
One-Way 操作

A one-way operation example:
一个 one-way 操作的例子:

<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 called "setTerm".
在这个例子中,端口 "glossaryTerms" 定义了一个名为 "setTerm" 的 one-way 操作。

The "setTerm" operation allows input of new glossary terms messages using a "newTermValues" message with the input parameters "term" and "value". However, no output is defined for the operation.
个 "setTerm" 操作可接受新术语表项目消息的输入,这些消息使用一条名为 "newTermValues" 的消息,此消息带有输入参数 "term" 和 "value"。不过,没有为这个操作定义任何输出。


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" defines a request-response operation called "getTerm".
这个案例中的端口"glossaryTerms"定义了一个名为"getTerm"的“请求—回复”操作。

The "getTerm" operation requires an input message called "getTermRequest" with a parameter called "term", and will return an output message called "getTermResponse" with a parameter called "value".
"getTerm" 操作会请求一个名为 "getTermRequest" 的输入消息,此消息带有一个名为 "term" 的参数,并将返回一个名为 "getTermResponse" 的输出消息,此消息带有一个名为 "value" 的参数。

评论 (0) All

登陆 | 还没注册?