On Thu, Jan 7, 2010 at 3:35 PM, Mauro Molinari
<mauro.molin...@cardinis.com>wrote:

> 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.
>>
> ohh. this should be 'As Sosnoski has said it is not the the best solution'
:) Sorry for mistake.

thanks,
Amila.

>
> 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
> E-mail: mauro.molin...@cardinis.com
> _______________________________________________
> CARDINIS Solutions
> Via San Crispino, 46
> 35129 Padova - Italy
> Tel. +39 0498072095
> Fax +39 0497800824
> http://www.cardinis.com
>
> ---
> 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.
>



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

Reply via email to