Hi all, Amila wrote:
On Nov 15, 2007 8:33 PM, Mauro Molinari <[EMAIL PROTECTED]> wrote: [...] > 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. If I can add my opinion, nillable booleans, as well as nillable integers, if secified as such in the WSDL, should be translated by the framework to the most correct representations, i.e java.lang.Boolean and java.lang.Integer. The contract is specified by the WSDL, not by the underlying framework, which is expected to do the best possible translation. Best regards, Marco
