On 06/10/2014 7:49 AM, santodip wrote:
I have written a web service using CXF. The WSDL contains one of the field as
'boolean'. Unfortunately at runtime I found that when "trud", "trua" or
"truee" is passed through that field, it accepts the value as "true". This
should have been a "false" value for a boolean field.

Any suggestion is highly appreciated



--
View this message in context: 
http://cxf.547215.n5.nabble.com/CXF-accepts-tru-for-boolean-fields-tp5749458.html
Sent from the cxf-user mailing list archive at Nabble.com.


By the same argument "fals", "falsee", "fase" should all be considered as "true" since they are not "false". Unfortunately, Boolean only has 2 possible values and lacks a way to signal"wtf?".

You might want to document your web service to warn programmers writing clients to use booleans properly and warn them that the results will be indeterminate if they send values other than "true" or "false". What happens if you send in "dog" or "cat" as the Boolean? What would you like to happen?

You could use a string instead of a Boolean if you need to handle non-Boolean input. Then you can parse the input and decide what you want "truee" or "dog" to mean.



--
Ron Wheeler
President
Artifact Software Inc
email: rwhee...@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102

Reply via email to