You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
yes you need to override the transport.py
I have overridden the method like
`
def post_xml(self, address, envelope, headers):
"""Post the envelope xml element to the given address with the headers.
This method is intended to be overriden if you want to customize the
serialization of the xml element. By default the body is formatted
and encoded as utf-8. See ``zeep.wsdl.utils.etree_to_string``.
"""
message = etree_to_string(envelope)
if 'Radius="NotSet"' in message.decode('utf-8'):
message = message.decode('utf-8').replace('Radius="NotSet"', 'Radius="10.00"')
message = message.encode('utf-8')
return self.post(address, message, headers)
Which results in the following error coming back from the API:
org.xml.sax.SAXParseException; cvc-elt.4.3: Type 'ns0:COMPONENT_TYPE' is not validly derived from the type definition, 'null', of element 'component'.
But passing in the dictionary instead, generates the correctly formatted XML that the API is expecting, it's just not populating the values as we would expect:
hi @ciscomonkey. Did you figure out a solution for this or just used suds-community instead.
Not sure if I get your comment above where you mentioned:
But passing in the dictionary instead, generates the correctly formatted XML that the API is expecting, it's just not populating the values as we would expect:
After spending quiet a bit of time trying to figure out why this may be happening, I noticed that it may have something to do with value being overwritten to NotSet in subsequent calls to render for scenarios where you have sequence in complexType and that is being extended by another complexType. After debugging through the code, I noticed that the render function is called twice for ComplexType that has sequence probably because of this.
I added a return statement here and that seemed to have fixed the issue but I am unsure if this will have side affect on something else. This is my first time working with zeep so unsure if my conclusion from these observations are correct.
@mvantellingen not sure if you are still maintaining this project but was curious to here your thoughts on whether this makes sense.
We hit the same issue in our project. I’ve posted a fix in PR #1476.
@ffmc-mayank could you check whether this fix also solves your issue? You commented on this thread quite recently, so you might still be interested. @mvantellingen could you take a look at this if you’re still actively involved in the project?
Activity
ciscomonkey commentedon Dec 9, 2019
I'm having this same issue. Did you ever find out anything on this?
<component type="NotSet" dbid="NotSet"/>ciscomonkey commentedon Dec 9, 2019
I did test this morning, and this works correctly using suds-community.
hassam-theentertainerme commentedon Dec 10, 2019
yes you need to override the transport.py
I have overridden the method like
`
def post_xml(self, address, envelope, headers):
"""Post the envelope xml element to the given address with the headers.
`
ciscomonkey commentedon Dec 10, 2019
It appears that Zeep is not populating the values of the automatically converted object from the dictionary we are passing it.
Using get_type:
Or factory:
Generates this XML:
Which results in the following error coming back from the API:
But passing in the dictionary instead, generates the correctly formatted XML that the API is expecting, it's just not populating the values as we would expect:
llech commentedon Nov 5, 2020
@ciscomonkey I've got similar issues, only that your solution doesn't work for me because my object is used as attribute, not as child tag...
elmorek commentedon Nov 5, 2020
hi @ciscomonkey. Did you figure out a solution for this or just used suds-community instead.
Not sure if I get your comment above where you mentioned:
What do you mean? Can you provide an example?
Thanks
ciscomonkey commentedon Dec 6, 2020
@elmorek I just went with suds-community for this project.
powo commentedon Aug 4, 2023
I've been experiencing the same problem
When passing a dict to a Operation (eg
{"locale": "EN", "aNumber": "1234"}), it results in a Request with"NotSet":<Request locale="NotSet" aNumber="1234" />Here's en excerpt of the WSDL
highviolet commentedon Nov 9, 2023
@powo Did you find a solution?
ffmc-mayank commentedon Jul 23, 2025
After spending quiet a bit of time trying to figure out why this may be happening, I noticed that it may have something to do with value being overwritten to
NotSetin subsequent calls to render for scenarios where you havesequenceincomplexTypeand that is being extended by anothercomplexType. After debugging through the code, I noticed that the render function is called twice forComplexTypethat has sequence probably because of this.I added a
returnstatement here and that seemed to have fixed the issue but I am unsure if this will have side affect on something else. This is my first time working with zeep so unsure if my conclusion from these observations are correct.@mvantellingen not sure if you are still maintaining this project but was curious to here your thoughts on whether this makes sense.
fix: preserve attribute values when extending complexType
swozny13 commentedon Nov 26, 2025
We hit the same issue in our project. I’ve posted a fix in PR #1476.
@ffmc-mayank could you check whether this fix also solves your issue? You commented on this thread quite recently, so you might still be interested.
@mvantellingen could you take a look at this if you’re still actively involved in the project?