WSDL Binding


WSDL binding defines message format 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"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <operation> <soap:operation soapAction="http://example.com/getTerm"/> <input><soap:body use="literal"/></input> <output><soap:body use="literal"/></output> </operation> </binding>

bindingThe 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, which is the "glossaryTerms" port in this example.

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

The style attribute can take the value "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.

operationThe element defines the operations provided by each port.

For each operation, the corresponding SOAP behavior needs to be defined. You must also specify how the input and output are encoded. In this example we used "literal".

Other Extensions