Hi all,

I need to replicate this wsdl using spyne

<xs:complexType name="MyType">
    <xs:simpleContent>
        <xs:extension base="xs:string">
            <xs:attribute name="version" type="xs:string"/>
        </xs:extension>
    </xs:simpleContent>
</xs:complexType>

It's a complex type that extends a string adding an attribute.


I'm using spyne from the master branch


First attempt


class MyType(ComplexModel):
    __namespace__ = "uri:my-ns"
    __extends__ = primitive.Unicode
    version = XmlAttribute(primitive.Unicode)

that produces:

<xs:complexType name="MyType">
    <xs:attribute name="version" type="xs:string"/>
</xs:complexType>


Second attempt (with a patched spyne)

class MyType(ComplexModel):
    __namespace__ = "uri:my-ns"
    __extends__ = primitive.Unicode
    version = XmlAttribute(primitive.Unicode)

that produces:

<xs:complexType name="MyType">
    <xs:complexContent>
        <xs:extension base="xs:string">
            <xs:attribute name="version " type="xs:string"/>
        </xs:extension>
    </xs:complexContent>
</xs:complexType>


Thank you
david
_______________________________________________
Spyne community mailing list
people@spyne.io
http://lists.spyne.io/listinfo/people

Reply via email to