= Converting Descriptions in SOAP to Python data structures = 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. 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. 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: * [http://www.w3.org/TR/xmlschema11-2/#int xsd:int]: an integer value * [http://www.w3.org/TR/xmlschema11-2/#string xsd:string]: a string value * [http://www.w3.org/TR/xmlschema11-2/#boolean xsd:boolean]: a boolean value * [http://www.w3.org/TR/xmlschema11-2/#base64Binary xsd:base64Binary]: an opaque binary value * [http://www.w3.org/TR/xmlschema11-2/#dateTime xsd:dateTime]: an encoded date and time * [http://www.w3.org/TR/xmlschema11-2/#float xsd:float]: a floating point value * [http://www.w3.org/TR/xmlschema11-2/#double xsd:double]: a double precision floating point value 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. 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}}} complex type (from [source:wsdl/trunk/fedd_types.xsd]) is described in xsd as: {{{ LAN in the virtual topology of a federated experiment (Emulab legacy). The fields are the name of the LAN/link (vname) the node that this description applies to (vnode), the IP of the connection, and performance information. }}} translates into a python dict like: {{{ vlantopoType = { 'vname': 'string', 'vnode': 'string2', 'ip': '10.1.1.1', 'bandwidth': 100, 'delay': 0.35, 'member': 'member_string', } }}} }}}