axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Hawes <mike.ha...@ombiel.com>
Subject Default value for double datatype
Date Wed, 21 May 2014 09:14:35 GMT
I've written a web service with Axis2 1.6.2 with a parameter of
type="xsd:double". I've tried to give it a default value of 0, but any time
I call the web service without defining that parameter it still gets a
value of Double.NaN. I'm using org.apache.axis2.tool.ant.AntCodegenTask
with the adb data binding. This is the type I use in the definition of a
web service request:

    <xsd:complexType name="someSortOfType">
        <xsd:sequence>
            ...
            <xsd:element name="aDoubleParam" type="xsd:double"
minOccurs="0" maxOccurs="1" default="0" />
            ...
        </xsd:sequence>
    </xsd:complexType>

The parameter "aDoubleParam" gets the value "NaN" if it is not specified in
the request, even though the default is 0. This behaviour is also different
to what happens if I perform a unit test, setting up the request in my own
Java code. In that case the parameter gets a default value of 0 when I
create a new SomeSortOfType object, even if I don't specify a default.
These seem to be bugs in Axis2. Is this a known issue? What would be the
best way to deal with this?

Best regards,
Mike

-- 
campusM: http://www.campusM.com
Email: mike.hawes@ombiel.com
Tel: 01902 837451

Mime
View raw message