[ 
https://issues.apache.org/jira/browse/AXIS2-1272?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Amila Chinthaka Suriarachchi resolved AXIS2-1272.
-------------------------------------------------

    Resolution: Fixed

set the MIN_VALUE  in corresponding wrapper classes as the null value for 
long,int,short and byte . 
set the NaN in corresponding wrapper classes as the null value for float and 
double. Now it is possible to handle null values even with the primitives.

> Cannot differentiate between an int sent as 0 and an int sent as nil
> --------------------------------------------------------------------
>
>                 Key: AXIS2-1272
>                 URL: https://issues.apache.org/jira/browse/AXIS2-1272
>             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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to