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 Dave Cherkassky <dc...@djinnsoft.com> on 2010/03/11 16:07:28 UTC

How to get a Boolean (capital B)

Question:

Let's say I have the following in my WSDL:
   <xs:element name="isSupervisor" minOccurs="0" maxOccurs="1" type="xs:boolean" />

When I run WSDL2JAVA, I get the following:
   protected boolean localIsSupervisor ;
   protected boolean localIsSupervisorTracker = false ;
   public  boolean getIsSupervisor(){
     return localIsSupervisor;
   }
   public void setIsSupervisor(boolean param){
     if (false) {
       localIsSupervisorTracker = false;
     } else {
       localIsSupervisorTracker = true;
     }
     this.localIsSupervisor=param;
   }

So that's all good.  The values are true and false.


However, let's say I want a Boolean (capital B), so that the values are null, Boolean.TRUE, Boolean.FALSE.  How should I structure the WSDL to create a Boolean field?


As a follow-up, is there a reference somewhere that lists all the WSDL-to-Java type mappings that Axis2 uses?

Many thanks,
-- 
Dave Cherkassky
   VP of Software Development
   DJiNN Software Inc.
   416.504.1354

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: How to get a Boolean (capital B)

Posted by Dave Cherkassky <dc...@djinnsoft.com>.
Amila:

That's great, but that makes *all* booleans into Booleans (and int's into Integers, etc).  I was hoping to be able to changes specific elements on a case-by-case basis.

Any other suggestions?

Thanks,
-- 
Dave Cherkassky
   VP of Software Development
   DJiNN Software Inc.
   416.504.1354


On 12/03/2010 1:13 AM, Amila Suriarachchi wrote:
> On Thu, Mar 11, 2010 at 8:37 PM, Dave Cherkassky<dc...@djinnsoft.com>wrote:
>
>> Question:
>>
>> Let's say I have the following in my WSDL:
>>   <xs:element name="isSupervisor" minOccurs="0" maxOccurs="1"
>> type="xs:boolean" />
>>
>> When I run WSDL2JAVA, I get the following:
>>   protected boolean localIsSupervisor ;
>>   protected boolean localIsSupervisorTracker = false ;
>>   public  boolean getIsSupervisor(){
>>     return localIsSupervisor;
>>   }
>>   public void setIsSupervisor(boolean param){
>>     if (false) {
>>       localIsSupervisorTracker = false;
>>     } else {
>>       localIsSupervisorTracker = true;
>>     }
>>     this.localIsSupervisor=param;
>>   }
>>
>> So that's all good.  The values are true and false.
>>
>>
>> However, let's say I want a Boolean (capital B), so that the values are
>> null, Boolean.TRUE, Boolean.FALSE.  How should I structure the WSDL to
>> create a Boolean field?
>>
>
> try with -Euwc option.
>
> Amila.
>
>>
>>
>> As a follow-up, is there a reference somewhere that lists all the
>> WSDL-to-Java type mappings that Axis2 uses?
>>
>> Many thanks,
>> --
>> Dave Cherkassky
>>   VP of Software Development
>>   DJiNN Software Inc.
>>   416.504.1354
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: How to get a Boolean (capital B)

Posted by Amila Suriarachchi <am...@gmail.com>.
On Thu, Mar 11, 2010 at 8:37 PM, Dave Cherkassky <dc...@djinnsoft.com>wrote:

> Question:
>
> Let's say I have the following in my WSDL:
>  <xs:element name="isSupervisor" minOccurs="0" maxOccurs="1"
> type="xs:boolean" />
>
> When I run WSDL2JAVA, I get the following:
>  protected boolean localIsSupervisor ;
>  protected boolean localIsSupervisorTracker = false ;
>  public  boolean getIsSupervisor(){
>    return localIsSupervisor;
>  }
>  public void setIsSupervisor(boolean param){
>    if (false) {
>      localIsSupervisorTracker = false;
>    } else {
>      localIsSupervisorTracker = true;
>    }
>    this.localIsSupervisor=param;
>  }
>
> So that's all good.  The values are true and false.
>
>
> However, let's say I want a Boolean (capital B), so that the values are
> null, Boolean.TRUE, Boolean.FALSE.  How should I structure the WSDL to
> create a Boolean field?
>

try with -Euwc option.

Amila.

>
>
> As a follow-up, is there a reference somewhere that lists all the
> WSDL-to-Java type mappings that Axis2 uses?
>
> Many thanks,
> --
> Dave Cherkassky
>  VP of Software Development
>  DJiNN Software Inc.
>  416.504.1354
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>


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