WSDL 绑定文档为由特定 portType 定义的操作和消息定义协议详细信息。WSDL 绑定文档相当于发布到 UDDI 注册中心的 tModel 或服务接口。可以生成包含所有 WSDL 元素的整体式 WSDL 文档,也可以生成单独的 WSDL 绑定文档。
WSDL 绑定文档是特定端口类型的具体协议和数据格式规范。绑定信息包含协议名、调用样式、服务标识和每个操作的编码。
以下 WSDL 绑定文档基于 StockQuoteService 样本。
<?xml version="1.0" encoding="UTF-8"?> <definitions name="StockQuoteServiceBinding" targetNamespace="http:///" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http:///"> <import location="StockQuoteService.wsdl" namespace="http:///"/>
<!-- The mapping to the actual transport protocol names is --> <!-- performed in the binding, the next part of the service --> <!-- interface file. StockQuoteServiceSOAPBinding is the SOAP --> <!-- binding for the port type. The binding describes --> <!-- which run-time protocol is supported by the service --> <!-- provider and contains protocol configuration information. -->
<wsdl:binding name="StockQuoteServiceSoapBinding" type="intf:StockQuoteService"> <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="getQuote"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="getQuoteRequest"> <wsdlsoap:body use="literal"/> </wsdl:input> <wsdl:output name="getQuoteResponse"> <wsdlsoap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding>