Why is zeep not accepting my attribute value?

I am trying to speak to a SOAP server of which I received a WSDL files and multiple XSD files. The python module I am using for that is zeep 4.2.1 with python 3.12. When I call a service, I get an error message that one of my attributes is not valid.

How can I specify the codingScheme as ‘A10’ without getting the ValidationError?

This is the code I use to call a service:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>parameters = {
...
'sender_MarketParticipant.mRID': {'_value_1': 'EAN', 'codingScheme': 'A10'},
...
}
return service.sendSchedule(**parameters)
</code>
<code>parameters = { ... 'sender_MarketParticipant.mRID': {'_value_1': 'EAN', 'codingScheme': 'A10'}, ... } return service.sendSchedule(**parameters) </code>
parameters = {
  ...
  'sender_MarketParticipant.mRID': {'_value_1': 'EAN', 'codingScheme': 'A10'},
  ...
}
return service.sendSchedule(**parameters)

This is the error that I get:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>ValidationError: The attribute codingScheme is not valid: Value is required (Schedule_MarketDocument.domain.mRID.codingScheme)
</code>
<code>ValidationError: The attribute codingScheme is not valid: Value is required (Schedule_MarketDocument.domain.mRID.codingScheme) </code>
ValidationError: The attribute codingScheme is not valid: Value is required (Schedule_MarketDocument.domain.mRID.codingScheme)

This is how the final XML should look like:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>...
<sender_MarketParticipant.mRID codingScheme="A10">EAN</sender_MarketParticipant.mRID>
...
</code>
<code>... <sender_MarketParticipant.mRID codingScheme="A10">EAN</sender_MarketParticipant.mRID> ... </code>
...
<sender_MarketParticipant.mRID codingScheme="A10">EAN</sender_MarketParticipant.mRID>
...

There is a lot of information in the WSDL and XSD files. I will include some snippets that might be relevant.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> <xs:complexType name="Schedule_MarketDocument" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#MarketDocument">
<xs:sequence>
...
<xs:element name="sender_MarketParticipant.mRID" type="PartyID_String" minOccurs="1" maxOccurs="1" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#IdentifiedObject.mRID"/>
...
</xs:sequence>
</xs:complexType>
</code>
<code> <xs:complexType name="Schedule_MarketDocument" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#MarketDocument"> <xs:sequence> ... <xs:element name="sender_MarketParticipant.mRID" type="PartyID_String" minOccurs="1" maxOccurs="1" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#IdentifiedObject.mRID"/> ... </xs:sequence> </xs:complexType> </code>
  <xs:complexType name="Schedule_MarketDocument" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#MarketDocument">
    <xs:sequence>
      ...
      <xs:element name="sender_MarketParticipant.mRID" type="PartyID_String" minOccurs="1" maxOccurs="1" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#IdentifiedObject.mRID"/>
      ...
    </xs:sequence>
  </xs:complexType>
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> <xs:complexType name="PartyID_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#String">
<xs:simpleContent>
<xs:extension base="PartyID_String-base">
<xs:attribute name="codingScheme" type="cl:CodingSchemeTypeList" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</code>
<code> <xs:complexType name="PartyID_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#String"> <xs:simpleContent> <xs:extension base="PartyID_String-base"> <xs:attribute name="codingScheme" type="cl:CodingSchemeTypeList" use="required"/> </xs:extension> </xs:simpleContent> </xs:complexType> </code>
  <xs:complexType name="PartyID_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#String">
    <xs:simpleContent>
      <xs:extension base="PartyID_String-base">
        <xs:attribute name="codingScheme" type="cl:CodingSchemeTypeList" use="required"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> <xsd:simpleType name="CodingSchemeTypeList">
<xsd:union memberTypes="cl:StandardCodingSchemeTypeList cl:LocalCodingSchemeType"/>
</xsd:simpleType>
</code>
<code> <xsd:simpleType name="CodingSchemeTypeList"> <xsd:union memberTypes="cl:StandardCodingSchemeTypeList cl:LocalCodingSchemeType"/> </xsd:simpleType> </code>
  <xsd:simpleType name="CodingSchemeTypeList">
    <xsd:union memberTypes="cl:StandardCodingSchemeTypeList cl:LocalCodingSchemeType"/>
  </xsd:simpleType>
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> <xsd:simpleType name="StandardCodingSchemeTypeList">
<xsd:annotation>
<xsd:documentation>
<Uid>ET0004</Uid>
<Definition>Codification scheme used to identify the coding scheme used for the set of coded values to identify specific objects.</Definition>
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="A01">
<xsd:annotation>
<xsd:documentation>
<CodeDescription>
<Title>IC</Title>
<Definition>The coding scheme is an Identification Coding Scheme</Definition>
</CodeDescription>
</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
...
<xsd:enumeration value="A10">
<xsd:annotation>
<xsd:documentation>
<CodeDescription>
<Title>LOCNR</Title>
<Definition>The coding scheme for the preceding attribute is a location number.</Definition>
</CodeDescription>
</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
</xsd:restriction>
</xsd:simpleType>
</code>
<code> <xsd:simpleType name="StandardCodingSchemeTypeList"> <xsd:annotation> <xsd:documentation> <Uid>ET0004</Uid> <Definition>Codification scheme used to identify the coding scheme used for the set of coded values to identify specific objects.</Definition> </xsd:documentation> </xsd:annotation> <xsd:restriction base="xsd:NMTOKEN"> <xsd:enumeration value="A01"> <xsd:annotation> <xsd:documentation> <CodeDescription> <Title>IC</Title> <Definition>The coding scheme is an Identification Coding Scheme</Definition> </CodeDescription> </xsd:documentation> </xsd:annotation> </xsd:enumeration> ... <xsd:enumeration value="A10"> <xsd:annotation> <xsd:documentation> <CodeDescription> <Title>LOCNR</Title> <Definition>The coding scheme for the preceding attribute is a location number.</Definition> </CodeDescription> </xsd:documentation> </xsd:annotation> </xsd:enumeration> </xsd:restriction> </xsd:simpleType> </code>
  <xsd:simpleType name="StandardCodingSchemeTypeList">
    <xsd:annotation>
      <xsd:documentation>
        <Uid>ET0004</Uid>
        <Definition>Codification scheme used to identify the coding scheme used for the set of coded values to identify specific objects.</Definition>
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:NMTOKEN">
      <xsd:enumeration value="A01">
        <xsd:annotation>
          <xsd:documentation>
            <CodeDescription>
              <Title>IC</Title>
              <Definition>The coding scheme is an Identification Coding Scheme</Definition>
            </CodeDescription>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
      ...
      <xsd:enumeration value="A10">
        <xsd:annotation>
          <xsd:documentation>
            <CodeDescription>
              <Title>LOCNR</Title>
              <Definition>The coding scheme for the preceding attribute is a location number.</Definition>
            </CodeDescription>
          </xsd:documentation>
        </xsd:annotation>
      </xsd:enumeration>
    </xsd:restriction>
  </xsd:simpleType>
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> <xsd:simpleType name="LocalCodingSchemeType">
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="A01"/>
</xsd:restriction>
</xsd:simpleType>
</code>
<code> <xsd:simpleType name="LocalCodingSchemeType"> <xsd:restriction base="xsd:NMTOKEN"> <xsd:enumeration value="A01"/> </xsd:restriction> </xsd:simpleType> </code>
  <xsd:simpleType name="LocalCodingSchemeType">
    <xsd:restriction base="xsd:NMTOKEN">
      <xsd:enumeration value="A01"/>
    </xsd:restriction>
  </xsd:simpleType>

I tried client.get_type('ns5:PartyID_String') but that gave the same error. I also tried to prefix the string ‘A10’ with extra type information but that didn’t seem to have any effect.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật