SOAP encoding is based on XML Schema and inherits its built-in data types. However, some data types which are commonly used in common computer languages, like arrays or structures are not covered in the XML Schema standard. The encoding of these data types for issuing remote procedure calls is mandatory, hence the SOAP standard itself specifies these specific data types.
Listing 7 shows a SOAP messages with SOAP encoded data. The data type of the element is added by adding a specific attribute to the XML tag.
Another variant of encoding SOAP messages is the encoding of data in anonymous tags, as shown in Listing 8. Here the name of the tag is not specified, so there is no meaningful identification of the element. This implementation works well with array data types where there is no need for naming the element.
An alternative to SOAP encoding would be to constrain SOAP message data by an external XML Schema document, similar to the examples in section 2.2. This way the SOAP Message has to contain a reference to a proper XML Schema document or a namespace in which the data types of the elements are defined18.
With the use of SOAP Encoding, serialization of various data types of common computer languages, like C/C++, Java, Perl or Python can be accomplished. Encoding is not machine dependent which greatly improves interoperability between Web Services. SOAP messages are like any XML document human legible, so developers can easily debug common problems by looking at the message itself.