Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zeep dont handle restriction on simpleTypes? #513

Open
00cc00 opened this issue Jul 26, 2017 · 7 comments · May be fixed by #960
Labels

Comments

@00cc00
Copy link

@00cc00 00cc00 commented Jul 26, 2017

  1. The version of zeep: 2.2.0 (python 2.7)
  2. The WSDL you are using
<xs:simpleType name="RollenEnum">
    <xs:restriction base="xs:string">
        <xs:enumeration value="VersichertePerson"/>
        <xs:enumeration value="Versicherungsnehmer"/>
        <xs:enumeration value="Beitragszahler"/>
        <xs:enumeration value="BezugsberechtigterImTodesfall"/>
        <xs:enumeration value="Ehepartner"/>
        <xs:enumeration value="GesetzlicherVertreter"/>
    </xs:restriction>
</xs:simpleType>

Hello there,

I'm only using the zeep library to parse WSDL files, so I don't use it as a real SOAP Client.

I need this to map it against own datamodels. However, I can't figure out if zeep handles restrictions in simpleTypes. The Type 'RollenEnum' is after parsing a 'String' BuiltinType. This is good in the first place. But I also need to map the restrictions like Enums and so on. Doesn't zeep support this or do I miss something?

I also tried to create Objects of this Type where I was able to input other Values than defined in the Enumeration.

Another example would be this:

<xs:simpleType name="someType">
    <xs:restriction base="xs:integer">
        <minInclusive value="0"/>
        <maxInclusive value="100"/>
    </xs:restriction>
</xs:simpleType>

Again, if I create a Type of 'someType' like so: someType(120) I don't get any Exception or something although the Value isn't valid like the Schema said.

So again my Question: Do I miss something or is this just not supported?

Thank you very much in advance for the help!

@Hansa064

This comment has been minimized.

Copy link

@Hansa064 Hansa064 commented Jul 31, 2017

I've got the same problem.
I need to be able to use restrictions to consume, validate and create WebServices.

The problem here seems to be, that the SchemaVisitor is reading the base of the restriction and returns and does not consume the children of the restriction tag. Here, handlers for the different restriction types need to be implemented.

Additionally, for creating WebServices, an API would be required to properly define such restrictions

@mvantellingen

This comment has been minimized.

Copy link
Owner

@mvantellingen mvantellingen commented Aug 12, 2017

Yeah the data validation is still not really implemented properly. I've started adding some validation based on if something is required or not but thats it. It's something I want to focus on next (and can definitely use help on this)

@bartkl

This comment has been minimized.

Copy link

@bartkl bartkl commented Jun 13, 2018

@mvantellingen To what extent could pre-existing XSD validation libraries be used to simplify the task of implementation here? I'm not familiar with any, just wondering out loud ;). Would be great if zeep could become capable of (close to) full XSD validation support combined with its already great type inspection.

@mvantellingen

This comment has been minimized.

Copy link
Owner

@mvantellingen mvantellingen commented Jun 13, 2018

There are no xsd validation libraries for python. Originally I intended to rely on lxml for validation but that doesn’t support xsd schema linking at the wsdl level.

Validation shouldn’t be too hard, just haven’t given it priority

@sanjayhallan

This comment has been minimized.

Copy link

@sanjayhallan sanjayhallan commented Jul 6, 2018

+1 for this issue
I am moving from suds to zeep as google has moved their googleads-python-lib to zeep from suds.
I'm trying to get a enum type which works but has no attributes :-), so not much use
I will need to use the suds client to handle enum types - not ideal having two soap clients hanging around.
Cheers
Sanjay

@carlosmaguda

This comment has been minimized.

Copy link

@carlosmaguda carlosmaguda commented Aug 21, 2018

@mvantellingen I have urgency on this matter. Kindly contact me so that we can work something out.

@set92

This comment has been minimized.

Copy link

@set92 set92 commented Apr 16, 2019

I suppose there are no development in this feature no? So the temporal fix I suppose is to use other library? Someone has a recommendation? Even if it is in another language, because I think suds is worse than Zeep, and there isn't a better one than Zeep in Python

hirochachacha added a commit to hirochachacha/python-zeep that referenced this issue May 9, 2019
Added initial implementations. Some constraints are still missing.

Fixes mvantellingen#513
@hirochachacha hirochachacha referenced a pull request that will close this issue May 9, 2019
hirochachacha added a commit to hirochachacha/python-zeep that referenced this issue May 9, 2019
Added initial implementations. Some constraints are still missing.

Fixes mvantellingen#513
hirochachacha added a commit to hirochachacha/python-zeep that referenced this issue May 9, 2019
Added initial implementations. Some constraints are still missing.

Fixes mvantellingen#513
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.