English 中文(简体)
在WSDL中,<约束力>和<portType”之间的区别是什么?
原标题:What s the difference between <binding> and <portType> in WSDL?

<代码>< binding> and <portType>似乎界定了一种操作及其信息。 我不理解,为什么两者都是必要的?

问题回答

http://www.ohchr.org。 (Analogs至Java接口)

  • PortType is an abstraction part of WSDL.
  • An abstract set of operations supported by one or more endpoints.

  • Binding is an concrete part of WSDL.
  • Describes how the operation is invoked by specifying concrete protocol and data format specifications for the operations and messages.
  • , 约束力为三类:

    1. SOAP Binding:
      SOAP binding allows either document or rpc style with either encoding or literal. Encoding indicates how a data value should be encoded in an XML format (These rules specify how "something" is encoded/serialized to XML and then later decoded/de-serialized from XML back to "something"). Literal means that the data is serialized according to a schema (this is just plain XML data). With transportation type http, jms, smtp...

    2. HTTP GET & POST binding:
      WSDL includes a binding for HTTP 1.1 s GET and POST verbs in order to describe the interaction between a Web Browser and a web site.

    3. MIME binding: WSDL includes a way to bind abstract types to concrete messages in some MIME format.


enter image description here

WSDL 2.0:

  • PortTypes renamed to interfaces
  • Ports renamed to endpoints
  • Removed message constructs

http://download.oracle.com/otn_hosted_doc/jdeveloper/1012/web_services/ws_wsdlruct.html>rel=“noreferer”><>


有用联系

<>Interfaces (wsdl:portType)

WSDL港 类型要素界定了一组业务(有时称为接口)。

The operation elements contain a combination of input and output elements. There can be a fault element when you have an output element. The order of these elements defines the message exchange pattern (MEP) (One-way, Request – Response, etc)

“entergraph

<>strong>wsdl: binding

妇发组织具有约束力的要素描述了使用特定港口类型和特定议定书的具体细节。

“entergraph

PortType defines the abstract interface of a web service.
Conceptually it is like a Java interface since it defines an abstract type and related methods.
In WSDL the port type is implemented by the binding and service elements which indicate the protocols, encoding schemes etc to be used by a web service implementation
I.e. the binding specifies concrete implementation details and essentially maps a portType to a set of protocols (HTTP and SOAP) message styles (Document/RPC) and encodings (literal)
Is the distiction clear now?

portType
A single Web service can support a number of different protocols. The structure of the data depends on the protocol that you use to invoke the Web service. Because of this, you need a way to map from the operations to the endpoints from which they can be accessed. The portType element takes care of this mapping.

您可以设立港口 为本网络服务提供的每项议定书的类型定义。 例如,您可使用 SOAP, HTTP-POST 和HTTP-GET<>。 操作名称是网上服务提供的方法。

binding
You can define how the end user binds to a port where the operation is obtainable. You do this by using the element.

wsdl:portType goes with wsdl:operation i.e. we are in the realms of messages and xml as such

but wsdl:binding goes with soap:binding and soap:operation i.e. we are in the realm of encoding, addresses, headers and rpc

e.g. from :

 <binding name="StockQuoteSoap" type="tns:StockQuotePortType">
        <soap:binding style="document" transport="http://example.com/smtp"/>
        <operation name="SubscribeToQuotes">
           <input message="tns:SubscribeToQuotes">
               <soap:body parts="body" use="literal"/>
               <soap:header message="tns:SubscribeToQuotes" part="subscribeheader" use="literal"/>

............。

<binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="GetTradePrice">
       <soap:operation soapAction="http://example.com/GetTradePrice"/>
       <input>
           <soap:body use="encoded" namespace="http://example.com/stockquote"
                      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>

......

以及从第3.2段获得的关于低水平通信的所有可能细节:

《SOAP》 具有约束力的条约将《世界发展权利宣言》及其以下延伸内容:

<definitions ....... >
    <binding ....... >
        <soap:binding style="rpc|document" transport="uri">
        <operation ....... >
           <soap:operation soapAction="uri"? style="rpc|document"?>?
           <input>
               <soap:body parts="nmtokens"? use="literal|encoded"
                          encodingStyle="uri-list"? namespace="uri"?>
               <soap:header message="qname" part="nmtoken" use="literal|encoded"
                            encodingStyle="uri-list"? namespace="uri"?>*
                 <soap:headerfault message="qname" part="nmtoken" use="literal|encoded"
                                   encodingStyle="uri-list"? namespace="uri"?/>*
               <soap:header>                                
           </input>
           <output>
               <soap:body parts="nmtokens"? use="literal|encoded"
                          encodingStyle="uri-list"? namespace="uri"?>
               <soap:header message="qname" part="nmtoken" use="literal|encoded"
                            encodingStyle="uri-list"? namespace="uri"?>*
                 <soap:headerfault message="qname" part="nmtoken" use="literal|encoded"
                                   encodingStyle="uri-list"? namespace="uri"?/>*
               <soap:header>                                
           </output>
           <fault>*
               <soap:fault name="nmtoken" use="literal|encoded"
                           encodingStyle="uri-list"? namespace="uri"?>
            </fault>
        </operation>
    </binding>

    <port ....... >
        <soap:address location="uri"/> 
    </port>
</definitions>




相关问题
IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

ASP.net web services

I am using a web service which sets the Thread.CurrentPrincipal object while logging in and soon later when another webmethod of the same web service accesses Thread.CurrentPrincipal, its different/...

Unity Container Disposing and XML Web Service

I am registering some wrapers over un-managed objects in container. How can I dispose of them at the end of the container s lifetime? Please bear in mind I have an XML Web service.

SharePoint : web service permission error

I have a sharepoint site, and I am calling a standard sharepoint web service. I create the web service request like this : wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx"; When I use ...