You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Li Ma <li...@gmail.com> on 2009/12/28 02:59:31 UTC

unwrap primitives with ADB

Hi there,

I'm upgrading from Axis1 to Axis2 now. In Axis1, method:
Integer getMyInt()
will be converted to:
Integer getMyInt();

So I can return null to indicate special situation, such as value not
defined.

But in Axis2, it's been change to:
int getMyInt();

I know if I do not unwrap when do WSDL2Java, I can perform extra check on
weather the value has been assigned or not. But I have to unwrap the code,
otherwise, change of my existing code will be unbearable.

Any idea how I can keep my Integer type?

Thanks!

-- 
Li Ma
lima01@gmail.com

Re: unwrap primitives with ADB

Posted by Li Ma <li...@gmail.com>.
I passed the following data mapping file to wsdl2java script, the int type
still cannot be mapped to Integer:
<?xml version="1.0" encoding="UTF-8"?>
<mappings dbf="adb"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="MappingFile.xsd">
   <mapping>
     <qname namespace="http://www.w3.org/2001/XMLSchema">int</qname>
     <value>java.lang.Integer</value>
   </mapping>
   <mapping>
     <qname namespace="http://www.w3.org/2001/XMLSchema">long</qname>
     <value>java.lang.Long</value>
   </mapping>

</mappings>

Li

On Mon, Dec 28, 2009 at 1:43 PM, Li Ma <li...@gmail.com> wrote:

> Any comment on this? I'm desperately waiting for an answer now.
>
> Thanks in advance!
>
> Li
>
>
> On Sun, Dec 27, 2009 at 8:59 PM, Li Ma <li...@gmail.com> wrote:
>
>> Hi there,
>>
>> I'm upgrading from Axis1 to Axis2 now. In Axis1, method:
>> Integer getMyInt()
>> will be converted to:
>> Integer getMyInt();
>>
>> So I can return null to indicate special situation, such as value not
>> defined.
>>
>> But in Axis2, it's been change to:
>> int getMyInt();
>>
>> I know if I do not unwrap when do WSDL2Java, I can perform extra check on
>> weather the value has been assigned or not. But I have to unwrap the code,
>> otherwise, change of my existing code will be unbearable.
>>
>> Any idea how I can keep my Integer type?
>>
>> Thanks!
>>
>> --
>> Li Ma
>> lima01@gmail.com
>>
>>
>
>
> --
> Li Ma
> lima01@gmail.com
>
>


-- 
Li Ma
lima01@gmail.com

Re: unwrap primitives with ADB

Posted by Li Ma <li...@gmail.com>.
Hi Amila,

Thank you very much for your suggestion.
Problem with -Euwc is that there's no way to control what to be converted to
boxed primitive, what should not.
And there's nothing like MIN_VALUE to int for boolean type.

Any further suggestion? Maybe I should simply reconstruct my code for this
migration.

Thanks and Happy New Year!

Li

On Fri, Jan 1, 2010 at 12:20 AM, Amila Suriarachchi <
amilasuriarachchi@gmail.com> wrote:

>
>
> On Tue, Dec 29, 2009 at 12:13 AM, Li Ma <li...@gmail.com> wrote:
>
>> Any comment on this? I'm desperately waiting for an answer now.
>
>
> use -Euwc option to generate wrapped classes.
>
> or you can use Integer.MIN_VALUE as the null value.
>
> thanks,
> Amila.
>
>>
>> Thanks in advance!
>>
>> Li
>>
>>
>> On Sun, Dec 27, 2009 at 8:59 PM, Li Ma <li...@gmail.com> wrote:
>>
>>> Hi there,
>>>
>>> I'm upgrading from Axis1 to Axis2 now. In Axis1, method:
>>> Integer getMyInt()
>>> will be converted to:
>>> Integer getMyInt();
>>>
>>> So I can return null to indicate special situation, such as value not
>>> defined.
>>>
>>> But in Axis2, it's been change to:
>>> int getMyInt();
>>>
>>> I know if I do not unwrap when do WSDL2Java, I can perform extra check on
>>> weather the value has been assigned or not. But I have to unwrap the code,
>>> otherwise, change of my existing code will be unbearable.
>>>
>>> Any idea how I can keep my Integer type?
>>>
>>> Thanks!
>>>
>>> --
>>> Li Ma
>>> lima01@gmail.com
>>>
>>>
>>
>>
>> --
>> Li Ma
>> lima01@gmail.com
>>
>>
>
>
> --
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/
>



-- 
Li Ma
lima01@gmail.com

Re: unwrap primitives with ADB

Posted by Amila Suriarachchi <am...@gmail.com>.
On Tue, Dec 29, 2009 at 12:13 AM, Li Ma <li...@gmail.com> wrote:

> Any comment on this? I'm desperately waiting for an answer now.


use -Euwc option to generate wrapped classes.

or you can use Integer.MIN_VALUE as the null value.

thanks,
Amila.

>
> Thanks in advance!
>
> Li
>
>
> On Sun, Dec 27, 2009 at 8:59 PM, Li Ma <li...@gmail.com> wrote:
>
>> Hi there,
>>
>> I'm upgrading from Axis1 to Axis2 now. In Axis1, method:
>> Integer getMyInt()
>> will be converted to:
>> Integer getMyInt();
>>
>> So I can return null to indicate special situation, such as value not
>> defined.
>>
>> But in Axis2, it's been change to:
>> int getMyInt();
>>
>> I know if I do not unwrap when do WSDL2Java, I can perform extra check on
>> weather the value has been assigned or not. But I have to unwrap the code,
>> otherwise, change of my existing code will be unbearable.
>>
>> Any idea how I can keep my Integer type?
>>
>> Thanks!
>>
>> --
>> Li Ma
>> lima01@gmail.com
>>
>>
>
>
> --
> Li Ma
> lima01@gmail.com
>
>


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

Re: unwrap primitives with ADB

Posted by Li Ma <li...@gmail.com>.
Any comment on this? I'm desperately waiting for an answer now.

Thanks in advance!

Li

On Sun, Dec 27, 2009 at 8:59 PM, Li Ma <li...@gmail.com> wrote:

> Hi there,
>
> I'm upgrading from Axis1 to Axis2 now. In Axis1, method:
> Integer getMyInt()
> will be converted to:
> Integer getMyInt();
>
> So I can return null to indicate special situation, such as value not
> defined.
>
> But in Axis2, it's been change to:
> int getMyInt();
>
> I know if I do not unwrap when do WSDL2Java, I can perform extra check on
> weather the value has been assigned or not. But I have to unwrap the code,
> otherwise, change of my existing code will be unbearable.
>
> Any idea how I can keep my Integer type?
>
> Thanks!
>
> --
> Li Ma
> lima01@gmail.com
>
>


-- 
Li Ma
lima01@gmail.com