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?

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]

Reply via email to