SOAP Binding

Web Services are based on an exchange of SOAP XML messages. A SOAP XML message consists of an envelope that contains a header and a body:

<soap:Envelope
  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" >
  <soap:Header>
    <!-- header element(s) here -->
  </soap:Header>
  <soap:Body>
    <!-- body element(s) here -->
  </soap:Body>
</soap:Envelope>

The binding element of a WSDL file describes how the service is bound to the SOAP messaging protocol. There are two possible SOAP binding styles: RPC and Document.

A SOAP binding can also have an encoded use, or a literal use. The use attribute is concerned with how types are represented in the XML messages. It indicates whether the message parts are encoded using some encoding rules, or whether the parts define the concrete schema of the message.

This means there are four potential style/use models. It is generally accepted that it is best practice to avoid using RPC/Literal or Document/Encoded. Therefore, the following are supported:

Each style has particular features that dictate how to create a WSDL file, and how to translate a WSDL binding to a SOAP message. Essentially these result in different formatting of the SOAP messages.

It is worth noting that document-oriented web services (DOWS) are regarded as a crucial enabling technology for developing solutions incorporating a Service Oriented Architecture (SOA). Document/Literal web services have emerged as the preferred style by bodies such as the Web Services Interoperability Organization (WS-I), an open industry group chartered to promote Web Services interoperability across platforms, applications, and programming languages. DOWS are self-describing web services (conform to XML Schemas) with no reliance on an external encoding (as with RPC). These features promote interoperability between heterogeneous applications, which is a central component for SOA.