developer:document_literal

SOAP WSDLs - Document/Literal

Example of the SOAP message

<soap:envelope>
    <soap:body>
        <xElement>5</xElement>
        <yElement>5.0</yElement>
    </soap:body>
</soap:envelope>

Here are the strengths and weaknesses of this approach:

Strengths

  1. There is no type encoding info.
  2. You can finally validate this message with any XML validator. Everything within the soap:body is defined in a schema.
  3. Document/literal is WS-I compliant, but with restrictions (see weaknesses).

Weaknesses

  1. The WSDL is getting a bit more complicated. This is a very minor weakness, however, since WSDL is not meant to be read by humans.
  2. The operation name in the SOAP message is lost. Without the name, dispatching can be difficult, and sometimes impossible.
  3. WS-I only allows one child of the soap:body in a SOAP message. As you can see in Listing 7, this example's soap:body has two children.

The document/literal style seems to have merely rearranged the strengths and weaknesses from the RPC/literal model. You can validate the message, but you lose the operation name.

developer/document_literal.txt · Last modified: 2011/03/02 13:45 by irina

Page Tools