Badly associated the first elements
When the first items are optional, easywsy removes them. This generates an association problem, that is, it assigns all the child elements of a tag that needs to be sent to another that was removed.
To solve this, we don't remove the first elements of the suds object (Suds already takes care of removing it)
In easywsy/ws/web_service.py function def _has_all_attrs(self, elem, parent_elem=None):
Replace this:
elif attr_val is None:
if not elem_def.optional():
raise WSError(
self.ws_url,
message=('%s\nElement %s should be filled. Check ' +
'the complete parent element above this ' +
'message') % (elem, attr_name))
else:
delattr(elem, attr_name)
For this:
elif attr_val is None:
if not elem_def.optional():
raise WSError(
self.ws_url,
message=('%s\nElement %s should be filled. Check ' +
'the complete parent element above this ' +
'message') % (elem, attr_name))
else:
if parent_elem != self.data._all_attrs._cur_root:
delattr(elem, attr_name)
Note: Ensure add optional tag names of first elements in NO_CHECK list