Hi,
We are calling a service getUserDetails(). It returns a complex type "userDetails" with various fields, let's say first/middle/last name to keep it simple. The WSDL says middleName is optional (it has <xs:element minOccurs='0' name='middleName' type='xs:string'/>).
Our code expects the return value to have a middleName attribute with a value of None if the middle name is not set.
However, what's happening is that the service (being written by a third party, I believe using JBoss and Axis) is not returning anything at all for this attribute. The complex type simply doesn't have it, so when we do details.middleName, we get an AttributeError.
I can't post the WSDL or response XML here on a public list, but basically it looks to me like the response is omitting the tag for the middle name altogether and Suds just ignores it, rather than consulting the WSDL and saying "this property should be here, it's not in the response, set it to None", as we were expecting.
Actually, there's one other problem: In the userDetails complex type, we have an attribute that's of another complex type, say "address". If This is not set, it comes through as an empty tag "<address />" in the response body. Suds treats that as an empty string, instead of None, as I would've expected.
So:
- Is this a problem with our understanding of Suds? - Is this a bug in Suds? - Is this in effect an invalid response from the server?
Cheers, lMartin