Search code examples
pythonxmlspyne

spyne - How to get a wrapping element surrounding a complex type


I want to recreate the following wsdl type definition

<!-- Existent non spyne specification -->
<s:element name="GetVehiclesResponse">
   <s:complexType>
       <s:sequence>
         <s:element minOccurs="0" maxOccurs="1" ref="s1:vehiclesResponse"/>
         <s:element ... />
    </s:sequence> 
  </s:complexType>
</s:element>

How do i get there? Cause when inheriting from ComplexModel my result looks similar to this

<!-- Result from ComplexModel -->
<xs:complexType name="GetVehiclesResponse">
  <xs:sequence>
    <xs:element ... />
    ...
  </xs:sequence>
</xs:complexType>

Should I implement a class that is deriving from ComplexModelBase?


Solution

  • The two notations are equivalent.