WSDL Bindings

WSDL bindings defines the message format and protocol details for a web service.

Binding to SOAP

A request-response operation example:

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

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

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

<binding type="glossaryTerms" name="b1">
   <soap:binding style="document"
   transport="" />
     <soap:operation soapAction=""/>
     <input><soap:body use="literal"/></input>
     <output><soap:body use="literal"/></output>

The binding element has two attributes - name and type.

The name attribute (you can use any name you want) defines the name of the binding, and the type attribute points to the port for the binding, in this case the "glossaryTerms" port.

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

The style attribute can be "rpc" or "document". In this case we use document. The transport attribute defines the SOAP protocol to use. In this case we use HTTP.

The operation element defines each operation that the portType exposes.

For each operation the corresponding SOAP action has to be defined. You must also specify how the input and output are encoded. In this case we use "literal".