WSDL中SOAP绑定和HTTP绑定的区别

5
我正在使用一个包含两个端口的WSDL文件 - 一个使用SOAP绑定,另一个使用HTTP绑定。 据我所知,SOAP是一种消息传递协议,但仍然使用HTTP作为传输协议。那么使用这两个端口有什么区别呢?
下面是包含绑定和服务的WSDL部分:
<wsdl:binding name="OperationServiceNextGenHttpBinding" type="tns:OperationServiceNextGenPort">

    <http:binding verb="POST"/>
    <wsdl:operation name="operation">

        <http:operation location="/operation"/>
        <wsdl:input>
            <mime:content type="application/x-www-form-urlencoded"/>


        </wsdl:input>
        <wsdl:output>
            <mime:content type="text/xml"/>
        </wsdl:output>
    </wsdl:operation>
</wsdl:binding>
<wsdl:binding name="OperationServiceNextGenSOAPBinding" type="tns:OperationServiceNextGenPort">

    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="operation">

        <soap:operation soapAction="http://some.schema.com/marketplace/search/v1/services/operation"/>
        <wsdl:input>

            <soap:body use="literal"/>
        </wsdl:input>
        <wsdl:output>

            <soap:body use="literal"/>
        </wsdl:output>
    </wsdl:operation>
</wsdl:binding>
<wsdl:service name="OperationServiceNextGen">
    <wsdl:documentation>
        <version>1.1.10</version>
    </wsdl:documentation>
    <wsdl:port binding="tns:OperationServiceNextGenHttpBinding" name="OperationServiceNextGenHttpPort">
        <http:address location="https://svcs.ebay.com/services/search/v1/OperationServiceNextGen"/>
    </wsdl:port>
    <wsdl:port binding="tns:OperationServiceNextGenSOAPBinding" name="OperationServiceNextGenSOAPPort">
        <soap12:address location="https://svcs.ebay.com/services/search/v1/OperationServiceNextGen"/>
    </wsdl:port>

</wsdl:service>
1个回答

3

让我简要解释一下。

一个具有SOAP绑定,另一个具有HTTP绑定

SOAP绑定 SOAP绑定定义了SOAP XML格式,即请求/响应XML必须是什么样子以及应包含哪些XML节点/命名空间等。

HTTP绑定

这个指的是如何传输SOAP XML /消息,即在这种情况下是否会通过HTTP / HTTPS进行传输。

据我所知,SOAP是一种消息协议,但仍然使用HTTP作为传输协议。那么使用这两个端口有什么区别?

大多数情况下传输协议是HTTP / HTTPS,但并非总是如此,SOAP也可以通过SMTP或FTP进行传输。

请参阅有关SOAP通过SMTP的更多信息。 https://teaching.shu.ac.uk/aces/ict/de/web_services/soap_over_http.htm# https://www.tutorialspoint.com/wsdl/wsdl_binding.htm


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接