Axis2 ADB generated classes do neither interpret nor validate booleans 
according to XML schema definition
---------------------------------------------------------------------------------------------------------

                 Key: AXIS2-2373
                 URL: https://issues.apache.org/jira/browse/AXIS2-2373
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: adb
    Affects Versions: 1.1.1
         Environment: Axis2, version 1.1.1. 
Tomcat 5.0
JDK1.6.0
            Reporter: Jonas Boëthius


Axis2 ADB generated classes do neither interpret nor validate booleans 
according to XML schema definition.

This bug consists of two parts, whereas the interpretation part is the most 
sever:
-A boolean value '1' is not interpreted as true after parsing a SOAP request 
(or response). 
-Any boolean value is accepted without validation error

The XML schema defines boolean accordingly: an instance of a datatype that is 
defined as boolean• can have the following legal literals {true, false, 1, 0}. 
Representing booleans with numbers 0 and 1 is quite common in some frameworks.

When generating Axis2 classes using the ADB data binding, the generated classes 
uses the org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean 
method to parse booleans. The implementation of this method is simply Java's 
interpretation of what is a Boolean (where the Boolean returned represents the 
value true if the string argument is not null and is equal, ignoring case, to 
the string "true"):

public static boolean convertToBoolean(String s) {
        return Boolean.valueOf(s).booleanValue();
    }

For the interpretation part, "true" and "1" should return true.

For validation part, all values but (case sensitive) 'true', 'false', '0' and 
'1' should generate some kind of fault (at least not be silently accepted).


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to