benkonrath / transip-api

Python implementation for the TransIP API
https://transip-api.readthedocs.io/en/latest/
MIT License
23 stars 23 forks source link

Fix invalid wsdl #62

Closed greenren closed 4 years ago

greenren commented 4 years ago

This is a fix for #60

The wsdl contains a type (xsd:array) that is not present in xsd (www.w3.org/2001/XMLSchema), which is why the wsdl is invalid. This fix uses the suds DocumentPlugin to patch the wsdl before parsing the document.

I'm not sure whether this is the best way to fix a faulty wsdl, but hopefully it's a step in the right direction.

benkonrath commented 4 years ago

I think the approach is good. Could you update the tests as well? Thanks.

greenren commented 4 years ago

I've adjusted the code and now the tests pass.

Transip confirmed that they've made a (breaking) change to their SOAP api. They're looking into the issue, but the implementation of a fix might take awhile.

greenren commented 4 years ago

Transip has told us that they're rolling out a fix for their SOAP api today. I'd suggest waiting with merging this PR, until we can confirm their fix and hopefully this patch will not be necessary.

meeuw commented 4 years ago

Sounds like a good idea! It looks like they fixed something, there is still one "xsd:array" left in https://api.transip.nl/wsdl/?service=DomainService

And they actually use tns:ArrayOfstring so I guess you were right with replacing xsd:array for that!

I'd like to add that this PR fixes the following error: suds.TypeNotFound: Type not found: '(array, http://www.w3.org/2001/XMLSchema, )' (for people who are searching for the above error)

benkonrath commented 4 years ago

@meeuw Thanks for doing the review and the info.

I don't use transip these days and I just want to double check we're on the same page. I can merge this PR and do a new release. As I see it, even if they do update the API, this code will continue work. Is this correct?

meeuw commented 4 years ago

Is this correct?

I agree, this is safe to merge, I'll keep an eye on it for how long it's required.

benkonrath commented 4 years ago

Great, thanks! I've just released version 2.1.0 with this fix.