SOAP defines types corresponding to the following structural patterns often found in programming languages:

StructA "struct" is a compound value in which accessor name is the only distinction among member values, and no accessor has the same name as any other.
ArrayAn "array" is a compound value in which ordinal position serves as the only distinction among member values.

Above definition of a Struct makes clear that it can be represented as UML class and as xsd:complexType  definition using the all content model :

Figure: SOAP Structs and Arrays in XML Schemas and in UML

<xsd:complexType name="GoogleSearchResult">
   <xsd:all>
      <xsd:element name="documentFiltering" type="xsd:boolean"/>
      <xsd:element name="searchComments" type="xsd:string"/>
      <xsd:element name="estimatedTotalResultsCount"
               type="xsd:int"/>
      <xsd:element name="estimateIsExact" type="xsd:boolean"/>
      <xsd:element name="resultElements"
               type="typens:ResultElementArray"/>
      <xsd:element name="searchQuery" type="xsd:string"/>
      <xsd:element name="startIndex" type="xsd:int"/>
      <xsd:element name="endIndex" type="xsd:int"/>
      <xsd:element name="searchTips" type="xsd:string"/>
      <xsd:element name="directoryCategories"
               type="typens:DirectoryCategoryArray"/>
      <xsd:element name="searchTime" type="xsd:double"/>
   </xsd:all>
 </xsd:complexType>
  
 <xsd:complexType name="DirectoryCategoryArray">
   <xsd:complexContent>
      <xsd:restriction base="soapenc:Array">
        <xsd:attribute ref="soapenc:arrayType"
        soapenc:arrayType="typens:DirectoryCategory[]"/>
      </xsd:restriction>
   </xsd:complexContent>
 </xsd:complexType>
  
 <xsd:complexType name="DirectoryCategory">
   <xsd:all>
      <xsd:element name="fullViewableName" type="xsd:string"/>
      <xsd:element name="specialEncoding" type="xsd:string"/>
   </xsd:all>
 </xsd:complexType>

The code sample above shows the complex type GoogleSearchResult having the content model 'all'. This means that each element within this model is identified by its name only. Thus, GoogleSearchResult corresponds to a SOAP Struct. In UML, SOAP Structs are represented by UML classes. This leads to the following

Mapping Rule: XSD complex types  having the content model 'all'  are mapped to UML classes. Elements being of simple type are mapped to class attributes elements being of complex type are mapped to UML associations.

However, above rule does not fully explain the class diagram found in Figure 428. The complex type GoogleSearchResult contains an element directoryCategories which refers to the type DirectoryCategoryArray. This type is neither are XSD simple nor an XSD complex type but a SOAP array type. SOAP arrays are a SOAP specific extension of XML Schemas. The syntax of this extension can also be found Figure 428 by inspecting the DirectoryCategoryArray type. This type defines a SOAP array containing DirectoryCategory elements. The following rule explains the representation of SOAP arrays in UML:

Mapping Rule: References to SOAP arrays  are mapped to associations to the array element of the SOAP array. This associations have lower multiplicity of 0 and upper multiplicity of '*'.

  • No labels