axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Davanum Srinivas (JIRA)" <>
Subject [jira] Updated: (AXIS2-1272) Cannot differentiate between an int sent as 0 and an int sent as nil
Date Wed, 31 Jan 2007 15:03:06 GMT


Davanum Srinivas updated AXIS2-1272:

    Assignee: Amila Chinthaka Suriarachchi

> Cannot differentiate between an int sent as 0 and an int sent as nil
> --------------------------------------------------------------------
>                 Key: AXIS2-1272
>                 URL:
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb, databinding
>    Affects Versions: nightly
>         Environment: Axis 2 nightly, Java 1.4.2, Tomcat 4
>            Reporter: Todd Doolittle
>         Assigned To: Amila Chinthaka Suriarachchi
> The service I deal with often sends back values a nil (or NULL).  For most datatypes,
such as String and Date the value of the object is NULL (using client code generated by WSDL2JAVA).
 However for anything that is an integer, it is set to 0.  This makes it impossible to tell
if the value in the message was really a 0, or if it was nil="true".  
> For example, the type in the wsdl is defined as...
> <xsd:element name="response">
>    <xsd:complextType>
>       <xsd:sequence>
>          <xsd:element name="firstNumber" type="xsd:int"/>
>          <xsd:element name="secondNumber" type="xsd:int"/>
>       </xsd:sequence>
>    </xsd:complexType>
> </xsd:element>
> The server returns this response...
> <response>
>    <firstNumber>0</firstNumber>
>    <secondNumber nil="true"/>
> </response>
> In the client code, response.getFirstNumber() would return 0, and response.getSecondNumber()
would also return 0.  
> To get around this could we do one of the following...
> **When an int is returned from a service as nil="true" set the value to Integer.MIN_VALUE.
> or
> **In the generated classes using java.lang.Integer instead of int and in the case of
a nil="true" response, set the Integer object to null.
> or
> **In the generated classes, for each int value include a isNull() method that would return
a boolean.
> Thanks!
> Todd

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:
For additional commands, e-mail:

View raw message