WSDL Binding Element

  • The <binding> element provides specific details on how a portType operation will actually be transmitted over the wire.
  • The bindings can be made available via multiple transports, including HTTP GET, HTTP POST, or SOAP.
  • The bindings provide concrete information on what protocol is being used to transfer portType operations.
    The bindings provide information where the service is located.
  • For SOAP protocol, the binding is <soap:binding>, and the transport is SOAP messages on top of HTTP protocol.
  • You can specify multiple bindings for a single portType.

The binding element has two attributes – the name attribute and the type attribute.

<binding name="HelloWorld_Binding" type="tns:HelloWorld_PortType">

The name attribute defines the name of the binding, and the type attribute points to the port for the binding, in this case the “tns:HelloWorld_PortType” port.
SOAP Binding

WSDL 1.1 includes built-in extensions for SOAP 1.1. This enables you to specify SOAP specific details, including SOAP headers, SOAP encoding styles, and the SOAPAction HTTP header. The SOAP extension elements include:

soap:binding
This element indicates that the binding will be made available via SOAP. The style attribute indicates the overall style of the SOAP message format. A style value of rpc specifies an RPC format.

The transport attribute indicates the transport of the SOAP messages. The value http://schemas.xmlsoap.org/soap/http indicates the SOAP HTTP transport, whereas http://schemas.xmlsoap.org/soap/smtp indicates the SOAP SMTP transport.

soap:operation
This element indicates the binding of a specific operation to a specific SOAP implementation. The soapAction attribute specifies that the SOAPAction HTTP header be used for identifying the service.

soap:body
This element enables you to specify the details of the input and output messages. In the case of HelloWorld, the body element specifies the SOAP encoding style and the namespace URN associated with the specified service.

Here is the piece of code from Example section:

<binding name="HelloWorld_Binding" type="tns:HelloWorld_PortType">
   <soap:binding style="rpc"
      transport="http://schemas.xmlsoap.org/soap/http"/>
   <operation name="sayHelloWorld">
      <soap:operation soapAction="sayHelloWorld"/>
      <input>
         <soap:body
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
            namespace="urn:examples:helloworldservice"
            use="encoded"/>
      </input>
      <output>
         <soap:body
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
            namespace="urn:dineshonjava:helloworldservice"
            use="encoded"/>
      </output>
     </operation>
   </binding>

References
Wikipedia for WSDL

 

<<Previous <<   || Index ||   >>Next >>
Previous
Next