The types element in the WSDL file encloses data type definitions that are relevant for the exchanged messages. For maximum interoperability and platform neutrality, WSDL prefers the use of XML Schema definitions (XSD) as the canonical type system, and treats it as the intrinsic type system.

The Importer supports XSD type system only.

Basically, XSD simple types correspond to built-in Bridge base types and XSD complex types are mapped to UML classes. The exact mapping rules depend on the used encoding scheme. If the types are used by messages being literal encoded, the Importer uses XSD to UML mappings as defined in section XML Schema Import Rules. If the types are used by messages being SOAP encoded, the Importer uses XSD to UML mappings as defined in the section SOAP Import Rules.

This difference is being made to check the schemas for syntactical correctness. For example, SOAP encoded types know a soapenc:arrayElement used to describe arrays as known from most programming languages. However, XML Schemas do not know this construct, that is, XML Schemas must be interpreted differently in a SOAP context. Vice versa, several XML Schema constructs like for example the xsd:choice content model cannot be mapped to the SOAP encoding formalism. This means, the Importer can detect invalid XML Schema variations only if it knows the encoding scheme (literal or SOAP).
Each schema contained in the types section is mapped to a corresponding package contained in the Imported Types root package. The names of these schema packages are derived by replacing all "/" in their target namespaces by ".".

The following table compares a WSDL type fragment to the package structure and the UML classes as generated by the Importer. Basically each XSD element is mapped to a class of name 'element_' + element name, each XSD complex type is mapped to a UML class having the same name and each XSD simple type is mapped to a Bridge base type (for instance: xsd:string becomes Base Types::String). More details are found in chapters XML Schema Import Rules and SOAP Import Rules.

Figure: WSDL types section and corresponding UML elements

<types> 
	<xsd:schema targetNamespace="http://example.com/stockquote.xsd"> 
	    <xsd:element name="TradePriceRequest"> 
	    	<xsd:complexType> 
	        	<xsd:all> 
	            	<xsd:element name="tickerSymbol" type="xsd:string"/> 
	            </xsd:all> 
	        </xsd:complexType> 
		</xsd:element> 
		    <xsd:element name="TradePrice"> 
	    	<xsd:complexType> 
	        	<xsd:all> 
	            	<xsd:element name="price" type="xsd:float"/> 
	            </xsd:all> 
	        </xsd:complexType> 
	    </xsd:element> 
	</xsd:schema> 
</types>

 

  • No labels