You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Mauro Molinari (JIRA)" <ji...@apache.org> on 2007/11/20 17:04:43 UTC

[jira] Created: (AXIS2-3353) User wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

User wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
----------------------------------------------------------------------------------------------------

                 Key: AXIS2-3353
                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
             Project: Axis 2.0 (Axis2)
          Issue Type: Improvement
          Components: codegen
    Affects Versions: 1.3
            Reporter: Mauro Molinari
            Priority: Critical


As of now, Axis2 WSDL2Java uses some weird convetion about "null".
I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
float, double => Float.NaN, Double.NaN
boolean => false

Actually, these values are NOT null.

I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.

If I understood it well, Axis1 did this, didn't it?

At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Resolved: (AXIS2-3353) Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amila Chinthaka Suriarachchi resolved AXIS2-3353.
-------------------------------------------------

    Resolution: Fixed

hi fixed the primitive type issue.
But I believe that the empty complex type unwrapping issue you have mention is not a real practical scenario (although it is theoretically correct). In fact it is bit difficult to fix it and I think that effort is not worth.
Please have a look at with the fixed issue.


> Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3353
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: codegen
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> As of now, Axis2 WSDL2Java uses some weird convetion about "null".
> I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
> Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
> int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
> float, double => Float.NaN, Double.NaN
> boolean => false
> Actually, these values are NOT null.
> I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.
> If I understood it well, Axis1 did this, didn't it?
> At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3353) Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

Posted by "Stein Henriksen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547456 ] 

Stein Henriksen commented on AXIS2-3353:
----------------------------------------

I also have the same problem using minOccurs="0" when running wsdl2java from build 01-Dec-2007 07:21. Command line:

call java org.apache.axis2.wsdl.WSDL2Java -or -Euwc -wv 1.1 -s -ss -sd -d adb -ns2p NStoPkg.properties -uri "../xml/document.wsdl" -o "../src" -S "java" -R "resources"

The generated adb beans contain wrappers of the primitives, but the parse method tries to set the wrapped primitives to the plain primitives which fails in compilation (convertToLong returns primitive long):

...
                                    protected java.lang.Long localCollateralId ;
...
                                              object.setCollateralId(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content));
...

> Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3353
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: codegen
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> As of now, Axis2 WSDL2Java uses some weird convetion about "null".
> I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
> Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
> int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
> float, double => Float.NaN, Double.NaN
> boolean => false
> Actually, these values are NOT null.
> I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.
> If I understood it well, Axis1 did this, didn't it?
> At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3353) Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

Posted by "Mauro Molinari (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546610 ] 

Mauro Molinari commented on AXIS2-3353:
---------------------------------------

Thank you Amila.
Yes, I'm using -uw option. By the way, regarding this there's still a problem with the unwrapping of empty beans (generated from empty complexTypes) when used as return parameters. Please have a look to my e-mail "Re: Axis2 WSDL2Java error during service skeliton/stub generation" of 2007/11/27 in axis-user mailing list, where I attached a WSDL that shows the problem. Let me know if you prefer me to open a new JIRA for that.

Anyway, tomorrow I'll try next nightly build to check your new fix for this issue.

> Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3353
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: codegen
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> As of now, Axis2 WSDL2Java uses some weird convetion about "null".
> I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
> Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
> int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
> float, double => Float.NaN, Double.NaN
> boolean => false
> Actually, these values are NOT null.
> I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.
> If I understood it well, Axis1 did this, didn't it?
> At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3353) Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

Posted by "Marco Trevisan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12543949 ] 

Marco Trevisan commented on AXIS2-3353:
---------------------------------------

I'm voting for this issue to be resolved.

When a value is nillable, replacing null occurrences with special (and not-so-special in case of boolean types) values is an information loss, and the application code needs to be reworked in order to guess if an input value could have been null. This is especially true with nillable boolean types, where the user code has no way to verify that a false value is either a real "false" or null. 
It's definitely the application's work to interpret null values, not axis' work. 

We can easily produce examples where the placeholder values chosen here are also valid values in the application:

-Boolean.
If I read from a table the nillable field "EvaluatedSummaryIsGood", whose contract is: 
1) true: the summary has been evaluated and its value is good;
2) false: the summary has been evaluated and its value is NOT good;
3) null: the summary has not been evaluated yet.

my business logic needs to read nulls instead of  "false".

-Integer
If I read from a table the nillable int field "AlgebricSumWithSaturation", whose contract is: 
1) any integer value resulting from the sum of N terms, supporting value saturation, when such sum has already been done
2) null, if the sum has yet to be done

the Integer.MIN_VALUE is pretty useful for me.

As you can tell, we can go on with as many examples as we want...

Best regards, 
   Marco

> Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3353
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: codegen
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Priority: Critical
>
> As of now, Axis2 WSDL2Java uses some weird convetion about "null".
> I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
> Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
> int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
> float, double => Float.NaN, Double.NaN
> boolean => false
> Actually, these values are NOT null.
> I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.
> If I understood it well, Axis1 did this, didn't it?
> At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-3353) Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

Posted by "Mauro Molinari (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mauro Molinari updated AXIS2-3353:
----------------------------------

    Summary: Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")  (was: User wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1"))

> Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3353
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: codegen
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Priority: Critical
>
> As of now, Axis2 WSDL2Java uses some weird convetion about "null".
> I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
> Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
> int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
> float, double => Float.NaN, Double.NaN
> boolean => false
> Actually, these values are NOT null.
> I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.
> If I understood it well, Axis1 did this, didn't it?
> At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3353) Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

Posted by "Stein Henriksen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547815 ] 

Stein Henriksen commented on AXIS2-3353:
----------------------------------------

Ahhh, I used Java5 but forgot to change the compliance level from 1.4  to 5. Thanks.

-Stein-

> Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3353
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: codegen
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> As of now, Axis2 WSDL2Java uses some weird convetion about "null".
> I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
> Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
> int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
> float, double => Float.NaN, Double.NaN
> boolean => false
> Actually, these values are NOT null.
> I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.
> If I understood it well, Axis1 did this, didn't it?
> At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3353) Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12549025 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-3353:
-----------------------------------------------------

I fixed the response unwrapping and minOccurs=0 problem you have mentioned. Please have a check.

> Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3353
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: codegen
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> As of now, Axis2 WSDL2Java uses some weird convetion about "null".
> I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
> Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
> int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
> float, double => Float.NaN, Double.NaN
> boolean => false
> Actually, these values are NOT null.
> I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.
> If I understood it well, Axis1 did this, didn't it?
> At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3353) Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

Posted by "Mauro Molinari (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12553929 ] 

Mauro Molinari commented on AXIS2-3353:
---------------------------------------

Hi Amila,
at a first sight, generated code for the wrapper type issue seems ok now, thank you!

Regarding the unwrapping issue: if you take the WSDL I attached here and change EmptyType so that it is:

<xsd:complexType name="EmptyType">
    <sequence>
      <element name="out" type="string"/>
    </sequence>
</xsd:complexType>

Axis2 can correctly unwrap the string parameter, so that "b" method returns a String, not EmptyType. Why doesn't this work anymore when there are no elements at all in EmptyType definition? Shouldn't this case be much like the empty anonymous empty type case of "a" method?

In practice, it is convenient to define an empty type in a shared schema file and use that type instead of declaring a new anonymous empty type every time you need to define an operation with an empty request or response...

Mauro.

> Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3353
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: codegen
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> As of now, Axis2 WSDL2Java uses some weird convetion about "null".
> I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
> Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
> int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
> float, double => Float.NaN, Double.NaN
> boolean => false
> Actually, these values are NOT null.
> I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.
> If I understood it well, Axis1 did this, didn't it?
> At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3353) Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

Posted by "Marco Trevisan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12544844 ] 

Marco Trevisan commented on AXIS2-3353:
---------------------------------------

Hi Amila,

Thanks very much for your comment and your decision!
I agree with you when you say three-state booleans are often due to bad programming, but as web service client programmers who need to interact with a third-party application, the only thing we can do is to take its behaviour as it is.

Best regards, 
  Marco

> Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3353
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: codegen
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> As of now, Axis2 WSDL2Java uses some weird convetion about "null".
> I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
> Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
> int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
> float, double => Float.NaN, Double.NaN
> boolean => false
> Actually, these values are NOT null.
> I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.
> If I understood it well, Axis1 did this, didn't it?
> At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3353) Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12544784 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-3353:
-----------------------------------------------------

ok, I'll add this to Axis2 1.4 .
But I think the example you gave for boolean type is about bad programming. you try to keep three states with a boolean variable. for this situation you have to use a short type varible.
Boolean is a wrapper class for primitive type boolean. normally we write logic with primitive boolean type.

> Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3353
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: codegen
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> As of now, Axis2 WSDL2Java uses some weird convetion about "null".
> I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
> Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
> int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
> float, double => Float.NaN, Double.NaN
> boolean => false
> Actually, these values are NOT null.
> I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.
> If I understood it well, Axis1 did this, didn't it?
> At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3353) Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546591 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-3353:
-----------------------------------------------------

fixed the issue, I think you get this problem with using with the -uw option. Please attach your wsdl if you still get the problem.

> Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3353
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: codegen
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> As of now, Axis2 WSDL2Java uses some weird convetion about "null".
> I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
> Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
> int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
> float, double => Float.NaN, Double.NaN
> boolean => false
> Actually, these values are NOT null.
> I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.
> If I understood it well, Axis1 did this, didn't it?
> At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3353) Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

Posted by "Mauro Molinari (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12545782 ] 

Mauro Molinari commented on AXIS2-3353:
---------------------------------------

Hi Amila,
I just tried the new nightly build.
Using -Euwc, now the ADBBeans are created correctly, as well as their Factory.parse(...) methods, but the service skeleton/interface (on server) and the stub (on client) are still using primitive values in their signatures. The MessageReceiver itself still uses only primitive types.
This causes a NullPointerException when a null is set on a bean and handled by the message receiver.

> Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3353
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: codegen
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> As of now, Axis2 WSDL2Java uses some weird convetion about "null".
> I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
> Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
> int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
> float, double => Float.NaN, Double.NaN
> boolean => false
> Actually, these values are NOT null.
> I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.
> If I understood it well, Axis1 did this, didn't it?
> At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3353) Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

Posted by "Mauro Molinari (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547798 ] 

Mauro Molinari commented on AXIS2-3353:
---------------------------------------

Hi Stein,
as stated by Amila, as of now you must use Java 5 to compile your code, because the generated code uses the auto-(un)boxing feature.

I think this is only needed when you user -Euwc switch.

Mauro.

> Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3353
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: codegen
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> As of now, Axis2 WSDL2Java uses some weird convetion about "null".
> I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
> Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
> int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
> float, double => Float.NaN, Double.NaN
> boolean => false
> Actually, these values are NOT null.
> I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.
> If I understood it well, Axis1 did this, didn't it?
> At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3353) Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12545382 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-3353:
-----------------------------------------------------

I added a new option -Euwc to generate the wrapper classes with minOccurs zero or nillable  true.
But this requires jdk 1.5 since it uses the autoBoxing. if you in jdk 1.5 go ahead with a nighly build.

> Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3353
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: codegen
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> As of now, Axis2 WSDL2Java uses some weird convetion about "null".
> I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
> Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
> int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
> float, double => Float.NaN, Double.NaN
> boolean => false
> Actually, these values are NOT null.
> I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.
> If I understood it well, Axis1 did this, didn't it?
> At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3353) Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

Posted by "Mauro Molinari (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547051 ] 

Mauro Molinari commented on AXIS2-3353:
---------------------------------------

Hi Amila,
I just tried the new nightly build (2007/11/30), but it does not work as expected yet.

Now, the skeleton/stub and the message receiver correctly use wrapper types when parameters are nillable, but still use primitive types when they are optional (minOccurs="0"/maxOccurs="1"), while the ADBBeans are generated correctly (they use wrapper types in both cases).

Mauro.

> Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3353
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: codegen
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> As of now, Axis2 WSDL2Java uses some weird convetion about "null".
> I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
> Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
> int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
> float, double => Float.NaN, Double.NaN
> boolean => false
> Actually, these values are NOT null.
> I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.
> If I understood it well, Axis1 did this, didn't it?
> At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3353) Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

Posted by "Mauro Molinari (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12549343 ] 

Mauro Molinari commented on AXIS2-3353:
---------------------------------------

Hi Amila!
minOccurs="0" problem seems to be fixed, thank you!

However, regarding the response unwrapping, it now works if responses are defined as elements of anonymous empty types, but still doesn't work when responses are defined as elements of global empty types. Please try the -uw parameter with the following WSDL, that shows all the cases (input and output empty types unwrapping, both using empty anonymous or global types). You'll see that method b is not void, but returns EmptyType:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:tns="http://mauro/Prova"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ProvaService"
  targetNamespace="http://mauro/Prova"
  xmlns:txsns="http://mauro/Prova/type">
  <wsdl:types>
    <xsd:schema targetNamespace="http://mauro/Prova/type"
      xmlns:txsns="http://mauro/Prova/type">
      <xsd:element name="aMethod">
        <xsd:complexType>

        </xsd:complexType>
      </xsd:element>

      <xsd:element name="aMethodResponse">
        <xsd:complexType />
      </xsd:element>

      <xsd:complexType name="EmptyType" />

      <xsd:element name="bMethodResponse" type="txsns:EmptyType">

      </xsd:element>

      <xsd:element name="bMethod" type="txsns:EmptyType" />
    </xsd:schema>
  </wsdl:types>

  <wsdl:message name="aMethodRequest">
    <wsdl:part element="txsns:aMethod" name="parameters" />
  </wsdl:message>
  <wsdl:message name="aMethodResponse">
    <wsdl:part element="txsns:aMethodResponse" name="parameters" />
  </wsdl:message>
  <wsdl:message name="bMethodRequest">
    <wsdl:part name="parameters" element="txsns:bMethod"></wsdl:part>
  </wsdl:message>
  <wsdl:message name="bMethodResponse">
    <wsdl:part name="parameters" element="txsns:bMethodResponse"></wsdl:part>
  </wsdl:message>
  <wsdl:portType name="ProvaService">
    <wsdl:operation name="aMethod">
      <wsdl:input message="tns:aMethodRequest" />
      <wsdl:output message="tns:aMethodResponse" />
    </wsdl:operation>
    <wsdl:operation name="bMethod">
      <wsdl:input message="tns:bMethodRequest"></wsdl:input>
      <wsdl:output message="tns:bMethodResponse"></wsdl:output>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="ProvaServiceSOAP" type="tns:ProvaService">

    <soap:binding style="document"
      transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="aMethod">

      <soap:operation soapAction="http://mauro/Prova/aMethod" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>

    <wsdl:operation name="bMethod">
      <soap:operation soapAction="http://mauro/Prova/bMethod" />

      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>

        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>

  <wsdl:service name="ProvaService">
    <wsdl:port binding="tns:ProvaServiceSOAP" name="ProvaServiceSOAP">
      <soap:address location="http://www.example.org/" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

Do you prefer me open a new issue for this or do you think here is enough?

Mauro.

> Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3353
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: codegen
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> As of now, Axis2 WSDL2Java uses some weird convetion about "null".
> I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
> Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
> int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
> float, double => Float.NaN, Double.NaN
> boolean => false
> Actually, these values are NOT null.
> I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.
> If I understood it well, Axis1 did this, didn't it?
> At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3353) Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

Posted by "Mauro Molinari (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12549367 ] 

Mauro Molinari commented on AXIS2-3353:
---------------------------------------

Hi Amila,
I found another problem regarding primitive types.

Now, suppose you have an xsd:element named "parentActivityId" which is not optional, so it is translated to Java primitive int.

In the ADBBean, the method <TypeName>.serialize(QName, OMFactory, MTOMAwareXMLStreamWriter, boolean) has some code that does:

if (localParentActivityId==java.lang.Integer.MIN_VALUE) {
  throw new org.apache.axis2.databinding.ADBException("parentActivityId cannot be null!!");
} else {
  xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localParentActivityId));
}

Now, if I specify -Euwc I'm expecting, for sure, that if nil is mapped to null, I can also use Integer. MIN_VALUE as an actual valid integer value for my parameter.
So, I don't know when this XML serialization method is called, however from what I see I suspect that the exchange of Integer.MIN_VALUE as a valid value for parentActivityId is something problematic, because of the piece of code I reported.

Could you please investigate?

Thank you.
Mauro.

> Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3353
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: codegen
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> As of now, Axis2 WSDL2Java uses some weird convetion about "null".
> I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
> Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
> int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
> float, double => Float.NaN, Double.NaN
> boolean => false
> Actually, these values are NOT null.
> I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.
> If I understood it well, Axis1 did this, didn't it?
> At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Assigned: (AXIS2-3353) Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3353?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amila Chinthaka Suriarachchi reassigned AXIS2-3353:
---------------------------------------------------

    Assignee: Amila Chinthaka Suriarachchi

> Use wrapper types when elements are optional (i.e.: nillable="true" or minOccurs="0"/maxOccurs="1")
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3353
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3353
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: codegen
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> As of now, Axis2 WSDL2Java uses some weird convetion about "null".
> I mean, when an element in a WSDL is marked as nillable="true" or minOccurs="0"/maxOccurs="1", the generated Java code still uses primitives types such as int, double, short, long, float, boolean.
> Because of this, I personally experienced (and also read about here in JIRA), Axis2 uses the following questionable convention to handle null values:
> int, short, long => Integer.MIN_VALUE, Short.MIN_VALUE, Long. MIN_VALUE
> float, double => Float.NaN, Double.NaN
> boolean => false
> Actually, these values are NOT null.
> I think Axis2 should map optional elements of type xsd:int, xsd:double, xsd:float, xsd:short, xsd:long, xsd:boolean to, respectively: Integer, Double, Float, Short, Long, Boolean and assign null to them when they are specified as nil or when they are not specified in the SOAP message.
> If I understood it well, Axis1 did this, didn't it?
> At least, I think Axis2 should give an option to enable this and, IMHO, I also think it should be on by default...

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org