Skip to content

Wsdl substitutionGroup not working #321

Open
@rahmonzoda

Description

@rahmonzoda

Hi Michael. Thank you for the excellent library.
One question or it is a bug

I have wsdl file

           <!--  Some elements -->
            <!-- group-id and transmit-shipment are mutually exclusive -->
            <xsd:element name="groupIdOrTransmitShipment" abstract="true" />
            <xsd:element name="group-id" type="tns:GroupIDType" substitutionGroup="tns:groupIdOrTransmitShipment"/>
            <xsd:element name="transmit-shipment" type="xsd:boolean" fixed="true" substitutionGroup="tns:groupIdOrTransmitShipment"/>

            <xsd:complexType name="ShipmentType">
                <xsd:all>
                    <xsd:element ref="tns:groupIdOrTransmitShipment" />
                    <xsd:element name="shipping-point-id" type="tns:OutletIDType" minOccurs="0" />
                    <xsd:element name="expected-mailing-date" type="xsd:date" minOccurs="0"/>
                    <xsd:element name="provide-pricing-info" type="xsd:boolean" fixed="true" minOccurs="0"/>
                    <xsd:element name="provide-receipt-info" type="xsd:boolean" fixed="true" minOccurs="0"/>
                    <xsd:element name="delivery-spec" type="tns:DeliverySpecType"/>
                </xsd:all>
            </xsd:complexType>
           <!--  Some elements -->

My python code

client = zeep.Client('path to wsdl file')

# i try like here
shipmentType = client.wsdl.types.get_type('ns0:ShipmentType')

shipment = shipmentType(**{
  'group-id': '123456', # how to add 'group-id' ?
  'shipping-point-id': '12345',
  ...
})

zeep indicates an error: ShipmentType() got an unexpected keyword argument 'group_id'.

XSD Element Substitution http://www.w3schools.com/xml/schema_complex_subst.asp

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions