WSDL 1.1 规范 - Bindings 介绍
filed in WebService和SOA on Apr.26, 2008, by javafuns
本系列目录 for 《WSDL 1.1 规范》
- WSDL 1.1 规范 - WSDL 中的几个 elements
- WSDL 1.1 规范 - WSDL各部分介绍
- WSDL 1.1 规范 - portType和operaton介绍
- WSDL 1.1 规范 - Types 介绍
- WSDL 1.1 规范 - Messages 介绍
- WSDL 1.1 规范 - Bindings 介绍
- WSDL 1.1 规范 - Ports 介绍
- WSDL 1.1 规范 - Services 介绍
- WSDL 1.1 规范 - WSDL 的多种 binding 方式
- WSDL 1.1 规范 - SOAP Binding
- WSDL 1.1 规范 - HTTP GET & POST Binding
- WSDL 1.1 规范 - MIME Binding
binding 对 portType 中的 operation 和消息格式进行 message 格式和协议详情的定义(与soap进行binding). 一个 portType 可能有数目不定的 binding. binding 语法如下:
<wsdl:binding name=”nmtoken” type=”qname”> *
<soap:binding style=”nmtoken” transport=”nmtoken”/>
<wsdl:operation name=”nmtoken”> *
<soap:operation soapAction=”nmtoken”/>
<wsdl:input name=”nmtoken”? > ?
</wsdl:input>
<wsdl:output name=”nmtoken”? > ?
</wsdl:output>
<wsdl:fault name=”nmtoken”> *
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
在 binding 中使用 type attribute 引用 portType.
binding 中的 operation 的名字要与该 binding 引用的 portType 中的 operation 的名字保持一致.
注意:由于 operation 的名字不要求唯一,因此这时会有重名情况,这就要求在 portType 定义时对 operation 的名字进行唯一性命名.
binding 必须而且只能指定一个通信协议,比如 http、smtp等
binding 不能指定 WSDL 实现地址信息
TODO: 本例中出现style、transport和soapAction是因为该绑定使用的是SOAP绑定,详见 http://blog.baturu.com/index.php/2008/04/29/wsdl-11-规范-soap-binding.html




Leave a Reply