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
Breaking behavior change was introduced in Jurko unreleased code #14
Comments
Hi @guifran001 thanks for opening an issue, very interesting! I've also noticed the unfortunate side effect that instantiating an object with optional attributes instantiates that object recursively. To quote from the commit message:
I don't think simply reverting the change is the right course, as the fix does address a valid usecase: passing an empty object. But perhaps we can separate the instantiation from the serialization? For example, instead of:
we instead do (ie forcing the explicit creation of empty objects):
I'm a little puzzled that the |
@guifran001 I've added a failing test for the undesired behavior in d34c3a5. Unfortunately adding the two lines back in don't make the test pass. Can you take a look at the test and make sure that it's describing the behavior in this issue? |
I'm going to take a look. Your test seem to test the right behavior |
I've found a fix. The test I've created that represent our current problem has a WSDL too complicated though, so I will add a service to your test because my first attempt to fix it was successful with your test, but not mine. |
Submitted a fix in pr #15 |
Closed by #15 |
In some unreleased versions of suds-jurko, all elements that were populated with empty lists. This was fixed in suds-commnunity as a regression, see #14, #15, and #16. This changes allows consumers of suds to have the suds-jurko behavior by doing the following: ``` from suds.client import Client, Builder class MyBuilder(Builder): def skip_value(self, type): return False # always set value client = Client('...') client.factory.builder = MyBuilder(client.factory.builder.resolver) ```
The following commit
b6d1d09
introduced a behavior change that breaks code that was using suds-jurko 0.6.
Since, this code was never released, I wonder if the commit could be reverted.
Originally, it was to fix this problem:
https://bitbucket.org/jurko/suds/issues/81
The original behavior was (suds-jurko 0.6):
When creating a sudsojbect.Object this way: client.factory.create("myObjectr"), the instanciated object has all its optional attributes were set to None and not added into the payload when calling a service with this object as argument.
The new behavior is (suds-community):
When creating a sudsojbect.Object this way: client.factory.create("myObject"), the instantiated object has all its optional attributes set. When calling a service with with this object as argument will result with having those optional attributes in the payload as .
I don't think the new behavior is correct, because if one updates a SOAP service to add an optional attribute to an object, it is absurd that all the clients using suds will start to add it by default and therefore change the expected behavior (the absence of an optional attribute is different than the presence of an empty attribute (for the server we are using at least)).
I've not been able to think of a solution for the original issue though, but it should not be fixed like that.
Can the commit be reverted ?
The text was updated successfully, but these errors were encountered: