在AXIS和CXF生成的WSDL中, 总是定义了三个绑定元素 如以下示例WSDL描述温度转换服务所述:
<wsdl:binding name="ConverterSoap11Binding" type="ns:ConverterPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="celsiusToFarenheit">
<soap:operation soapAction="urn:celsiusToFarenheit" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="farenheitToCelsius">
<soap:operation soapAction="urn:farenheitToCelsius" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="ConverterSoap12Binding" type="ns:ConverterPortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="celsiusToFarenheit">
<soap12:operation soapAction="urn:celsiusToFarenheit" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="farenheitToCelsius">
<soap12:operation soapAction="urn:farenheitToCelsius" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="ConverterHttpBinding" type="ns:ConverterPortType">
<http:binding verb="POST"/>
<wsdl:operation name="celsiusToFarenheit">
<http:operation location="celsiusToFarenheit"/>
<wsdl:input>
<mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
<mime:content type="application/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="farenheitToCelsius">
<http:operation location="farenheitToCelsius"/>
<wsdl:input>
<mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
<mime:content type="application/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
这三种绑定之间的区别是什么?
答案 0 :(得分:1)
首先看这个图wsdl structure
绑定:Read
因此,有三种方式(消息和传输协议)可以访问您的Web服务,即
ConverterSoap11Binding(消息协议:SOAP 1.1)
ConverterSoap12Binding(消息协议:SOAP 1.2)
ConverterHttpBinding(消息协议:HTTP POST)
以上所有绑定传输协议都是HTTP(如在您的服务地址中)。