Changes between Version 4 and Version 5 of SoapToPython
- Timestamp:
- Dec 4, 2010 5:24:50 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SoapToPython
v4 v5 3 3 The SOAP/xsd descriptions of fedd interfaces are portable across many programming languages and architectures, each with their own take on how to represent them internally. Because so much fedd code is written in python using the XSI package to encode and decode SOAP, we have placed some nodes on how to do the conversions. 4 4 5 The general layous of the [source:wsdl /trunk files] is that the message types are all in [source:wsdl/trunk/fedd_types.xsd fedd_types.xsd] while [source:wsdl/trunk/fedd.wsdl fedd.wsdl] contains the SOAP boilerplate to turn it all into request/response messages. [source:wsdl/trunk/fedd_internal.wsdl fedd_internal.wsdl] is some internal fedd interfaces and [source:wsdl/trunk/topdl.xsd topdl.xsd] is the XSD defintions for [FeddPluginArchitecture#TopologyDescriptionLanguage topdl], fedd's topology description language.5 The general layous of the [source:wsdl files] is that the message types are all in [source:wsdl/fedd_types.xsd fedd_types.xsd] while [source:wsdl/fedd.wsdl fedd.wsdl] contains the SOAP boilerplate to turn it all into request/response messages. [source:wsdl/fedd_internal.wsdl fedd_internal.wsdl] is some internal fedd interfaces and [source:wsdl/topdl.xsd topdl.xsd] is the XSD defintions for [FeddPluginArchitecture#TopologyDescriptionLanguage topdl], fedd's topology description language. 6 6 7 7 Though the full details are described by the W3C in [http://www.w3.org/TR/xmlschema11-1/ two] [http://www.w3.org/TR/xmlschema11-2/ documents], for fedd's purposes, the usage is simple enough. Messages are built up from simple XSD types composed into complex types. An element has a name and is part of a complex type and may either have a simple or complex type. Simple types in use by fedd include: … … 17 17 Each of these is encoded into python in the obvious ways. Doubles, floats and integers are python numbers; strings and base64Binaries are python strings; booleans are python variables set to True or False; and dateTimes are integers. 18 18 19 As simple element is encoded as a dictionary mapping between name and value. All the elements in the same sequence (an xsd grouping) are in the same dictionary. So, for example, the {{{vtopolanType}}} and {{{vtoponodeType}}} complex types (from [source:wsdl/ trunk/fedd_types.xsd]) are described in xsd as:19 As simple element is encoded as a dictionary mapping between name and value. All the elements in the same sequence (an xsd grouping) are in the same dictionary. So, for example, the {{{vtopolanType}}} and {{{vtoponodeType}}} complex types (from [source:wsdl/fedd_types.xsd]) are described in xsd as: 20 20 {{{ 21 21 <xsd:complexType name="visnodeType"> … … 79 79 Some elements are repeated multiple times in a type, or are optional, as noted by the {{{maxOccurs}}} and {{{minOccurs}}} attributes. Elements that have {{{maxOccurs="1"}}} and {{{minOccurs="0"}}} defined in the XSD are optional fields and may either occur in the sequence/dict or not. Elements with {{{maxOccurs="unbounded"}}} and {{{minOccurs="0"}}} defined in the XSD are repeated elements. If none appear, the key is missing from the dict, if one or more are present the value mapped to the element name in the dict is a list of hashes, one for each copy of the repeatable element present. 80 80 81 For example, the {{{vtopoType}}} from [source:wsdl/ trunk/fedd_types.xsd fedd_types.xsd] includes a pair of repeated elements. It is defined in XSD as:81 For example, the {{{vtopoType}}} from [source:wsdl/fedd_types.xsd fedd_types.xsd] includes a pair of repeated elements. It is defined in XSD as: 82 82 83 83 {{{ … … 105 105 }}} 106 106 107 Some types are defined not as a sequence, but as a choice. For example, an {{{IDType}}} is defined (in [source:wsdl/ trunk/fedd_types.xsd fedd_types.xsd] as the rest of these examples are) as:107 Some types are defined not as a sequence, but as a choice. For example, an {{{IDType}}} is defined (in [source:wsdl/fedd_types.xsd fedd_types.xsd] as the rest of these examples are) as: 108 108 109 109 {{{ … … 128 128 When represented as a dict, that will dict will have only one key, chosen from the set { 'uuid', 'fedid', 'uri', 'localname', 'kerberosUsername' }. 129 129 130 Others include restricted values, for example the {{{statusType}}} is defined in [source:wsdl/ trunk/fedd_types.xsd fedd_types.xsd]:130 Others include restricted values, for example the {{{statusType}}} is defined in [source:wsdl/fedd_types.xsd fedd_types.xsd]: 131 131 132 132 {{{