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

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

WSDL 绑定


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

WSDL bindings defines the message format and protocol details for a web service.
“WSDL 绑定”可为 Web service 的定义信息格式和协议细节。


Binding to SOAP
绑定到 SOAP

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>
<binding type="glossaryTerms" name="b1">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation>

<soap:operation
soapAction="http://example.com/getTerm"/>
<input>
<soap:body use="literal"/>
</input>
<output>

<soap:body use="literal"/>
</output>
</operation>
</binding>

The binding element has two attributes - the name attribute and the type attribute.
Binding[绑定]元素 元素有两个属性 - name 属性和 type 属性。

The name attribute (you can use any name you want) defines the name of the binding, and the type attribute points to the port for the binding, in this case the "glossaryTerms" port.
name 属性定义 binding 的名称,而 type 属性指向用于 binding 的端口,在这个例子中是 "glossaryTerms" 端口。

The soap:binding element has two attributes - the style attribute and the transport attribute.
soap:binding元素 元素有两个属性 - style 属性和 transport 属性。

The style attribute can be "rpc" or "document". In this case we use document. The transport attribute defines the SOAP protocol to use. In this case we use HTTP.
Style[样式] 属性 style 属性可取值 "rpc" 或 "document"。在这个例子中我们使用 document。transport 属性定义了要使用的 SOAP 协议。在这个例子中我们使用 HTTP。

The operation element defines each operation that the port exposes.
Operation [操作] 元素定义了每个端口提供的操作符。

For each operation the corresponding SOAP action has to be defined. You must also specify how the input and output are encoded. In this case we use "literal".
对于每个操作,相应的 SOAP 行为都需要被定义。同时您必须如何对输入和输出进行编码。在这个例子中我们使用了 "literal"。

评论 (0) All

登陆 | 还没注册?