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

时间:2018-09-05 10:57:41

标签: http soap wsdl

我正在使用一个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 个答案:

答案 0 :(得分:0)

让我尝试简单地解释一下。

  

一个具有肥皂绑定,另一个具有HTTP绑定

SOAP绑定 SOAP绑定定义SOAP XML格式,这意味着请求/响应的外观必须如何以及应包含的XML节点。

HTTP绑定

这里讨论的用于SOAP消息交换的传输协议将是HTTP / HTTPS。

  

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

在大多数情况下,传输协议是HTTP,但并非总是如此,SOAP可以通过SMTP或FTP传输,这在大多数情况下都是正确的。

请参阅SMTP上的一些SOAP信息。 https://teaching.shu.ac.uk/aces/ict/de/web_services/soap_over_http.htm# https://www.tutorialspoint.com/wsdl/wsdl_binding.htm

相关问题