Herong's Tutorial Notes on Web Service and SOAP
Dr. Herong Yang, Version 3.00

SOAP Data Model

This chapter describes what is SOAP data model.

SOAP Data Model is an extension of the SOAP framework specification that defines how data structures and values should be represented as a graph of nodes. SOAP Data Model is defined as an adjunct in SOAP 1.2 specification.

SOAP data model can be represented as a graph of nodes with the following 4 simple basic rules:

1. A data element with a simple value (a primitive data type value) is represented by a node with its value as the node label.

2. A data element with a compound value (an array or a structure of sub data elements) is represented by a node with directed edges pointing to nodes that represent it sub data elements. A directed edge originated from a node is called an outbound edge with respect to this node.

3. A reference to a data element is represented by a directed edge pointing to that data element. If a reference is named, the edged will be labeled with the reference name. Otherwise, a position number will be assigned to this edge, so the reference represented by this edge can be referred by this position number.

4. A data element with a compound value can only have either all outbound edges labeled, representing a data structure; or all outbound edges not labeled, representing a data array.

5. A reference to a data element is represented by a directed edge pointing to that data element. A directed edge pointing to a node is called an inbound edge with respect to this node.

Example 1 - Simple value with no reference: The following graph represents a simple value of 3.14:

   (3.14)

Example 2 - Simple value with a named reference: The following graph represents a simple value of 3.14 with a reference name of "pi":

   --- pi -->(3.14) 

Example 3 - Compound value with named sub data elements, a data structure: The following graph represents a compound value with a reference name of "currentCustomer". This compound value has 3 simple-value sub data elements referenced as "id", "name" and "isSmoking" respectively. In many programming language, this compound value is called a structure:

                         (2321)
                           ^
                           |
                          id
                           |
   --- currentCustomer -->( )-- name -->(Herong)
                           |
                       isSmoking
                           |
                           v
                        (false)

Example 4 - Compound value with positioned sub data elements, a data array: The following graph represents a compound value with a reference name of "colors". This compound value has 3 simple-value sub data elements referenced with no names, but with positions. In many programming languages, this compound value is called an array:

                (Red)
                  ^
                  |
                  0
                  |
   --- colors -->( )----1--->(Green)
                  |
                  2
                  |
                  v
                (Blue)

Example 5 - Multi references: The following graph represents two compound values sharing the same sub value.

   --- Bill -->( )--- mother --->               
                                ( )<-- Mary ---
   --- Mike -->( )--- sister --->               

Example 6 - Circular References: The following graph represents two compound values has each other as their sub values.

                 <--- son ------
   --- Bill -->( )             ( )<-- Mary ---
                 --- mother --->               

Conclusions: In my opinion, the SOAP data model is just a visual presentation of the object data model used in many object oriented programming languages. The only difference is that a data object in a programming language may also have methods.

The SOAP data model is really for another extension of the SOAP framework specification called SOAP encoding, which defines a set of rule to encoding data values into an XML format. See the next section for details.

Dr. Herong Yang, updated in 2007
SOAP Data Model