Both <binding>
and <portType>
seem to define an operation and its message. I don't quite understand, why are they both necessary?
相关问题
- Illegal to have multiple roots (start tag in epilo
- Newtonsoft DeserializeXNode expands internal array
- how to use special characters like '<'
- XML - XSLT - document() function inside count() fu
- convert logback.xml to log4j.properties
相关文章
- Creating XML Elements without namespace declaratio
- Using JAX-WS 2.2.5 client with JDK/JRE 1.5
- Get Attribute Value From Simple XML Using JQuery /
- Cannot use org.jvnet.jax-ws-commons.jaxws-maven-pl
- Directly signing an Office Word document using XML
- When sending XML to JMS should I use TextMessage o
- How to create base64Binary data?
- Fragment Content Overlaps Toolbar and Bottom Navig
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 (Analogs to Java interface)
binding
bindings are three types
SOAP Binding:
SOAP binding allows either
document
orrpc
style with eitherencoding
orliteral
. 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...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.
MIME binding: WSDL includes a way to bind abstract types to concrete messages in some MIME format.
In WSDL 2.0 :
Source
Useful links
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 : http://www.w3.org/TR/wsdl#_soap-b
.....
...
and from paragraph 3.2 all possible details about lower level communication stuff:
The SOAP Binding extends WSDL with the following extension elements:
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.
You can place a portType definition for each of the protocols available to you for this Web service. For instance, you can have individual portType definitions for using SOAP, HTTP-POST, and HTTP-GET. The operation name is the method available from the Web service.
binding
You can define how the end user binds to a port where the operation is obtainable. You do this by using the element.
Interfaces (wsdl:portType)
The WSDL portType element defines a group of operations (sometimes known as an interface).
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)
wsdl:binding
The WSDL binding element describes the concrete details of using a particular portType with a given protocol.