A binding defines message format and protocol details for operations and messages defined by a particular portType. Let us take a look at the first binding element from our WSDL to understand what it means:
- <binding name="FlightServicesSoap" type="s0:FlightServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <operation name="GetFlightStatus">
<soap:operation soapAction="http"//tempurl.org/GetFlightStatus style="document" />
- <input>
<soap:body use="literal" />
</input>
- <output>
<soap:body use="literal" />
</output>
</operation>
</binding>
Fig 8: SOAP binding definition from SAS Web Service WSDL document.
There are some important points that we need to observe in the binding element:
? ? The binding element refers to the portType (FlightServiceSoap) using “type” attribute.
? ? The binding element is the first element to specify a “protocol” (SOAP in Fig 8) in the WSDL document so far!
An operation element within a binding element specifies binding information for the operation specified in that particular binding’s portType. Since operation names are not required to be unique, the name attribute in the operation element might not be enough to uniquely identify an operation. In that case, providing the name attributes of the corresponding input and output elements should identify the correct operation
(Method Overloading!).
So a binding = protocol + portType