On Nov 15, 2007 8:33 PM, Mauro Molinari <[EMAIL PROTECTED]> wrote:
> Hello all!
> I'm writing a WSDL with an operation with an optional parameter:
>
> Suppose this is the input:
>
> <xsd:element name="somma">
>    <xsd:complexType>
>       <xsd:sequence>
>         <xsd:element name="a" type="xsd:int" minOccurs="0" />
>         <xsd:element name="b" type="xsd:int"/>
>       </xsd:sequence>
>     </xsd:complexType>
> </xsd:element>
>
> Or, alternatively, this:
>
> <xsd:element name="somma">
>    <xsd:complexType>
>       <xsd:sequence>
>         <xsd:element name="a" type="xsd:int" nillable="true" />
>         <xsd:element name="b" type="xsd:int"/>
>       </xsd:sequence>
>     </xsd:complexType>
> </xsd:element>
>
> WSDL2Java generates (using -uw):
>
> public returnType myOperation(int a, int b);
>
> while I would expect:
>
> public returnType myOperation(Integer a, int b);
>
> because a could be null!!!
> The same happens with return types.
>
> Looking at the source code of the generated type Somma, I see that the
> parser sets a to Integer.MIN_VALUE if it is absent (case #1) or nil
> (case #2): but why Axis2 uses this strange convention (MIN_VALUE = nil)
> instead of the much more natural null = nil?
As I remember there were some alternatives to this and this is what we did.
Idea was to keep the variable type as int since it is convenitent to use.

As you have told when it comes to boolean there is a problem.
In programming we use a boolean to keep two states. So Are we really
going to handle three states with the booleans.

thanks,
Amila.
> I guess something similar happens with other primitive types (double,
> for instance)...
>
> Thanks in advance!
>
> --
> Mauro Molinari
> Software Developer
> [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Amila Suriarachchi,
WSO2 Inc.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to