After binding has been specified, you need to determine how a SOAP message will be encoded within a WSDL document. You specify the encoding by using the use attribute of the soap:Body element. You define the soap:Body element within the input and output elements that represent the input and output of an operation.

The use attribute in the WSDL document defines the encoding style and can contain either of the two values, encoded or literal.

If the value of use is encoded, it specifies that encoding will follow the rules defined in the SOAP 1.1 specification. It indicates that the message parts are encoded using rules present in the URL specified by the encodingStyle attribute. The encodingStyle attribute is defined in the soap:Envelope element of the corresponding SOAP message.

If the value of use is literal, it indicates that the rules to encode and interpret the message parts are specified by an XML schema.

This combination of binding and encoding produces the following five modes of messaging:

In the code example, the use attribute within the body element is set to encoded.