Quoting David Mugnai (2016-09-21 14:39:05)
> Quoting Burak Arslan (2016-09-21 17:16:42)
> > Hey,
> > 
> > 
> > On 09/21/16 14:58, David Mugnai wrote:
> > > 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>
> > 
> > You seem to be looking for XmlData.
> > 
> > See here:
> > https://github.com/arskom/spyne/blob/0f587b2d606b54e41fc5cc3d33b51cc3b324a2ca/examples/xml/utils.py
> > 
> > If you run that file you can see the produced schema.
> > 
> > Does it help?
> 
> From a quick test it seems so!

First of all thank you, this declaration:

    class MyType(ComplexModel):
        version = XmlAttribute(primitive.Unicode)
        data = XmlData(primitive.Unicode)

results in the expected wsdl, great!

This declaration instead:

    class Refine(MyType):
        pass

results in this xml:

    <xs:complexType name="Refine">
        <xs:complexContent>
            <xs:extension base="MyType">
                <xs:simpleContent><xs:extension 
base="xs:string"/></xs:simpleContent>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

while the reference wsdl says:

    <xs:complexType name="Refine">
        <xs:simpleContent>
            <xs:extension base="MyType"/>
        </xs:simpleContent>
    </xs:complexType>

are the two xml equivalent? If not how can I change the `Refine` class
to match the expected wsdl?


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

Reply via email to