From: Marcus P. <ma...@pr...> - 2009-09-02 18:38:21
|
Hi List, I am new to ZSI, and starting to explore the (infinite) SOAP universe ;) i have some (as i think) rather unusual wsdl file i have to implement and ZSI fits in perfectly ! - thanks for the great work ! well, here is what i want to do: my wsdl file defines an attributegroup like this: <xsd:attributeGroup name="ValueAttributeGroup"> <xsd:attribute name="SensorId" use="required" type="xsd:unsignedInt"> </xsd:attribute> <xsd:attribute name="DataType" use="required" type="tns:DataTypeEnum"> </xsd:attribute> ... </xsd:attributeGroup> later on, i have a complex type defined which "enhances" the "xsd:double" type with the attributegroup: <xsd:complexType name="SensorValue"> <xsd:simpleContent> <xsd:extension base="xsd:double"> <xsd:attributeGroup ref="tns:ValueAttributeGroup" /> </xsd:extension> </xsd:simpleContent> </xsd:complexType> using ZSI-2.0-rc3's wsdl2py gives me the following piece of python code in *_types.py: class SensorValue_Def(ZSI.TCnumbers.FPdouble, TypeDefinition): # ComplexType/SimpleContent derivation of built-in type schema = "http://www.myapp.org/V01" type = (schema, "SensorValue") def __init__(self, pname, **kw): if getattr(self, "attribute_typecode_dict", None) is None: self.attribute_typecode_dict = {} # attribute handling code ZSI.TCnumbers.FPdouble.__init__(self, pname, **kw) class Holder(float): __metaclass__ = pyclass_type typecode = self self.pyclass = Holder however, when i create a new "SensorValue" instance via eg .new_SensorValueList () i need to specify the float value when instanciating and i am not able to specify the attributes via .set_attribute_* grepping the code unveils # TODO: Add derivation logic to constructors. in ZSI/generate/containers.py ;) well, can you please give some hints on what is missing (i.e. how the definition of the above mentioned class should look like), and how it can be implemented ... i am willing to give it a try ;) thanks for the great work ! regards, marcus. |