cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <>
Subject Re: CXF accepts 'tru*' for boolean fields
Date Mon, 06 Oct 2014 14:49:26 GMT

This is also not really a bug in CXF but a bug in the JDK.    The JAXB runtime would use javax.xml.bind.DatatypeConverter
to parse the booleans and if I write a quick test like:

    public void foo() {
    public static void doIt(String s) {
        Boolean b = javax.xml.bind.DatatypeConverter.parseBoolean(s);
        System.out.println(s + ": " + b);

I get:
true: true
1: true
trud: true
trus: true
trued: true

Thus, this is really outside of CXF’s control as Oracle would need to fix this in the JAXB

That said, you can turn on schema validation and that SHOULD catch this.     I believe the
schema validator is much much more strict about this.


On Oct 6, 2014, at 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:
> Sent from the cxf-user mailing list archive at

Daniel Kulp -
Talend Community Coder -

View raw message