Easy Tutorial
❮ Wsdl Ports Wsdl Syntax ❯

WSDL Binding

WSDL binding defines the message formats and protocol details for a web service.

Binding to SOAP

An example of a request-response operation:

Example

<message name="getTermRequest">
  <part name="term" type="xs:string"/>
</message>

<message name="getTermResponse">
  <part name="value" type="xs:string"/>
</message>

<portType name="glossaryTerms">
  <operation name="getTerm">
    <input message="getTermRequest"/>
    <output message="getTermResponse"/>
  </operation>
</portType>

<binding type="glossaryTerms" name="b1">
   &lt;soap:binding style="document"
   transport="http://schemas.xmlsoap.org/soap/http" />
   <operation>
     &lt;soap:operation soapAction="http://example.com/getTerm"/>
     <input><soap:body use="literal"/></input>
     <output><soap:body use="literal"/></output>
  </operation>
</binding>

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

The name attribute defines the name of the binding, while the type attribute points to the port used for the binding, in this case, the "glossaryTerms" port.

The soap:binding element has two attributes - the style attribute and the transport attribute.

The style attribute can take values "rpc" or "document". In this example, we use "document". The transport attribute defines the SOAP protocol to be used. In this example, we use HTTP.

The operation element defines the operators provided by each port.

For each operation, the corresponding SOAP action needs to be defined. You must also define how to encode the input and output. In this example, we use "literal".

❮ Wsdl Ports Wsdl Syntax ❯