Both <binding>
and <portType>
seem to define an operation and its message. I don't quite understand, why are they both necessary?
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.
In a WSDL file, a port type contains one or more related operations that the web service can perform. An example of an operation is GetQuote. The WSDL Editor supports the following categories of operations: Request-response. The operation receives a message as input, and sends a message as output.
A WSDL binding describes how the service is bound to a messaging protocol, particularly the SOAP messaging protocol. A WSDL SOAP binding can be either a Remote Procedure Call (RPC) style binding or a document style binding. A SOAP binding can also have an encoded use or a literal use.
The binding element of a WSDL file describes how the service is bound to the SOAP messaging protocol. There are two possible SOAP binding styles: RPC and Document. A SOAP binding can also have an encoded use, or a literal use. The use attribute is concerned with how types are represented in the XML messages.
portType (Analogs to Java interface)
binding
bindings are three types
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...
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With