Skip to content

Improve handling of out-of-order values in a sequence #499

Open

Description

@nmaludy

The version of zeep (or if you are running master the commit hash/date)

$ pip show zeep
Name: zeep
Version: 2.2.0

The WSDL you are using

https://gist.github.com/nmaludy/5b44b6b8ce6e0151481250521283d684

An example script

https://gist.github.com/nmaludy/e467d0e0d223d3fe0a9e49a424a08826

XML returned from GetRanges() call

https://gist.github.com/nmaludy/0a22fd84d4c41a7ad58e5cd250633059

Note The <inheritAccess> tag comes before the <autoAssign> tag in each range (this is out-of-order with respect to the sequence.

Details

Currently when a server returns values in a <sequence> that are out-of-order zeep throw an exception: https://gist.github.com/nmaludy/d21a6cc266c844298a0465f5d1da47e4

This is fine because technically this is not valid XML according to the WSDL schema. However, when i pass in strict=False to the client i get all of the out-of-order elements dumped into a _raw_elements list on the object. https://gist.github.com/nmaludy/db792168e466e7626ea102569aead04d

Thoughts

When passing strict=False would it be possible to handle out-of-order values in the sequence and assign them to the correct keys in the dict instead of dumping them to _raw_elements?

Activity

  1. mvantellingen commented on Jul 23, 2017

    @mvantellingen
    Owner

    If this is an AXIS soap server then this seems be a duplicate of #493
    Can you confirm that? (It seems only the axis servers are doing this completely wrong)

  2. nmaludy commented on Jul 24, 2017

    @nmaludy
    Author

    @mvantellingen I don't believe so, this is a Men&Mice IPAM server running on Windows IIS.

  3. mvantellingen commented on Aug 12, 2017

    @mvantellingen
    Owner

    Okay. I agree that this should be done better. I'll look into it

  4. added this to the 3.0 milestone on Aug 12, 2017
  5. Jitsusama commented on Oct 26, 2017

    @Jitsusama

    FYI; I opened up issue #596 before recognizing that it's a duplicate of this and #493. This is biting me really hard with my AXIS server. Feel free to take a look at my ticket for another example of how sorted children tags are causing breakage.

  6. nmaludy commented on Jan 26, 2018

    @nmaludy
    Author

    @mvantellingen If you can point me in the right direction i really wouldn't mind fixing it. I tried going through the code, but it it's my first time looking at it and i got a little lost in all of the lxml details.

  7. nmaludy commented on Apr 16, 2018

    @nmaludy
    Author

    @mvantellingen I'm still interested in helping out here, if you can help point me in the right direction!

  8. dankrause commented on Dec 7, 2018

    @dankrause
    Contributor

    You should now be able to use the xsd_ignore_sequence_order flag in the client's settings to parse responses that contain out of order items in a sequence.

  9. saper commented on Oct 5, 2021

    @saper

    @nmaludy are you sure that your IPAM server is not using Apache Axis library under the hood? I've run into this using some other solution and the xsd_ignore_sequence_order flag works perfectly for me.

  10. srichardson-sc commented on Nov 2, 2021

    @srichardson-sc

    You should now be able to use the xsd_ignore_sequence_order flag in the client's settings to parse responses that contain out of order items in a sequence.

    This worked perfectly for my issue with the _raw_elements issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions