Inconsistent handling of invalid boolean input parameters to a web service
Issue
In JBoss EAP 6.1.1, the following web service input parameters are mapped to the boolean value false:
test
fAlse
tRue
“ “ (single space)
whereas the following parameters are mapped to null:
asdf
TRUE
FALSE
True
False
and the following parameters result in an Unmarshalling error:
t
f
From a user’s perspective, this behavior is inconsistent and hard to understand.
- Is this behavior intended?
- Why not map all invalid boolean input parameters to the same value (false / null / unmarshalling error)?
- Is it possible that this behavior will change again in a future version? We noticed that AS 7.1.1 behaves differently.
- How can we enforce a certain, consistent behavior for our web services?
Example of UnmarshalException message:
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 1
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.