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
Support nil
s values
#24
Conversation
Return empty strings for empty strings rather than `None`
The nil did not work for me. I believe the namespace is also needed. Something like this: The debug seem to point to this as well: |
Looks like you're right, there may be problem you've mentioned. |
This merge is causing a problematic side effect. When sending a request, all parameter fields that aren't initialized are now being marshalled as xsi:nil="true" - even types that aren't nillable. All other SOAP clients that I've worked with, including WCF, Metro, and SUDS, will not marshal uninitialized parameter fields into the soap request. This keeps the message more compact, and more importantly, the server should be able to assign excluded fields to the default value of their type, instead of being told that it is nil or null. Also, if I understand correctly, I believe that pull request #22 already fixed this issue without causing the extra problem. Can anybody test and verify this is correct? |
I'm in doubt with this one too, specially in sort_dict that is appending null tags now when before it was specifically banned (BTW, the comment is still there...). I think that until xsi:nil is correctly parsed from the WSDL, this should be modified to be avoided by default in some way... Sorry I don't have time to review in more depth, but it would be wise if those that're interested could propose unit tests so we can take further action with more concrete details. |
I agree with Mariano. The problem with sort_dict is that it doesn't know if the WSDL has defined that type as nullable. Until this can be properly fixed, does anyone agree that this pull request should be reversed? |
Please @dotnetdan , go ahead |
Anton, Until now, I didn't realize that your original change for pull #24 was about the server - everything I have said up until now was about the client. I am only using the PySimpleSoap client to connect to an existing web service (built in C# and WCF). I do not use the PySimpleSoap server at all. As soon as I get a chance, I am going to test if I can put back the changes you made to the Unmarshalling logic. I'll follow up on that soon. Let me know if that works for you. |
No-no, there is nothing about PySimpleSoap-server, I don't use it like that ether. In #24 there is 2 commits, both for PySimpleSoap-client — receiving and sending I'm using PySimpleSoap-client with I'll test your solution for my case, until that I continue to use my old patch. |
Would be great if this is some option that can be turned on -- as the revert here basically caused errors on an existing service I'm connected to. Would this be an option so that I can use the latest version without needing to tag a specific version via commit hash. |
Parse response
<item />
as empty string (None
now), and<item xsi:nil="true" />
asNone
.Send
<item xsi:nil="true" />
nodes forNone
values in the request (it drops it out now).As usual, tests haven't become worse.