How Do I ... : Web Services Tips, Hints and FAQs : How does VAST default serializer determine the XML schema type for an object that is defined as 'anyType'?
How does VAST default serializer determine the XML schema type for an object that is defined as 'anyType'?
The algorithm for processing 'anyType' and for processing 'subtypes' is very similar.
A new mapping spec is introduced (contained in 'abtvast.map') to represent the Smalltalk namespace. The new mapping spec is intended to describe how Smalltalk objects should map to XML schema types. For typical mapping specs, it is possible to have multiple types map to the same object; therefore, determination of a schema type from an object instance is ambiguous. The Smalltalk namespace mappings remove ambiguity because each object maps to a single schema type.
For many cases, it is not necessary to refer to the Smalltalk mapping spec in order to determine a proper type mapping. The Smalltalk namespace exists strictly to remove ambiguity when the same class can map to multiple types.
When trying to determine the 'actual' type for an object, VAST does the following:
Check the schema of the base schema type to see if there is a more specialized type that matches the class name of the object being serialized.
Try to find a mapping for the class name of the serialized object and use the mapping to determine the actual schema type. The mapping is searched for in:
Smalltalk mapping namespace
Base type namespace
All other visible namespaces (namespaces visible at that point in serialization of the object)
For types other than anyType, if no specialized type is found, the baseType is assumed to be the serialization type.
For an anyType, if no specialized type is found, a type definition is constructed based on the class shape. The type is created in the "VA Smalltalk" namespace. The "Smalltalk" namespace is settable in the serialization configuration. The default value is urn:Vast and is globally settable in the pool variable AbtXmlConstants::AbtXmlSmalltalkNamespace.
-------------------------------
Last modified date: 04/08/2023