axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mauro Molinari <>
Subject Re: [Axis2] making minOccurs=1 by default for wsdl generated with POJO
Date Thu, 07 Jan 2010 10:05:02 GMT
Amila Suriarachchi ha scritto:
> ok then lets make minOccurs = 1 by default. As Sosnoski has said it is 
> the the best solution. but that make everyone life easier.

Sorry, I can't find where Sosnoski says that minOccurs=1 by default for 
every kind of parameters is the best solution.
He said that it's the best to use minOccurs=1 for primitives (as I 
said), while he preferred to keep on using minOccurs=0 for object types, 
while I was saying it was preferrable to use nillable=true because of 
.NET compatibility.

Moreover, if you use minOccurs=1 always, generating a client with Axis2 
from the resulting WSDL, will then lead to the use of primitives that 
CANNOT let you specify a null value.

So, the actual result is:

=> starting from public Integer methodA(Integer a);
=> Java2WSDL generates a WSDL with both the return type and the 
parameter type as mandatory (minOccurs=1, not specified but inherited as 
XML Schema default)
=> if you generate a client with WSDL2Java you'll get:
public int methodA(int a);

So, a client would not be able to call the service speciying null as the 
input parameter and could not handle null as the return type.

That's not good at all!

Mauro Molinari
Software Designer & Developer
CARDINIS Solutions
Via San Crispino, 46
35129 Padova - Italy
Tel. +39 0498072095
Fax +39 0497800824

Questo messaggio è strettamente riservato ai destinatari specificati.
Se è ricevuto per errore si prega di avvisare il mittente e di 
cancellarlo dal proprio sistema.
This message is specifically addressed to the recipient(s).
Should you receive it by mistake, please notify the sender and delete it 
from your system.

View raw message