Matthew Holloway wrote:
Hi folks,
Is there an example or a test that shows how nillable elements should be handled?
No, but you can simply set the object value to None and suds will marshall based on the schema.
I've got an old Apache Axis (2005 build) that can't just have
an empty node but wants the following attributes on the element,
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"
I've hacked an...
if self.isnil(): result.append(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"')
...into the appropriate part of bindings/unmarshaller.py's str() but I'm not sure if the Axis server's WSDL is just broken.
The Suds marshaller will (should) set the xsi:nil="true" for you but only when the schema specifies that the element may be null:
<element name="foo" nillable="true"/>
Does the schema for the element in question specify that it may be set null? Also, what is the minOccurs?
So, is there a test case for this?
Not sure. I'll have to look at my axis 1 & 2 wsdls.
-- .Matthew Holloway http://creativefreedom.org.nz/ http://holloway.co.nz/
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list