Hi Amila,

It's definitely best to use minOccurs=1 for primitives. nillable=true is *not* a good choice in general, and I'd recommend you instead go with minOccurs=0 for object types.

Why is nillable=true bad? 1. It requires the element to still be present in the message, adding unnecessary bloat (including the xsi namespace definition and usage) and confusion for human viewers of the message. 2. If required attributes are defined for the element (not an issue for POJO deployment, since it doesn't use attributes, but applicable in terms of the general use of nillable=true) those attributes need to be present even with xsi:nil=true in the document. minOccurs=0 is a cleaner representation of optional values.

 - Dennis

--
Dennis M. Sosnoski
Java XML and Web Services
Axis2 Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Amila Suriarachchi wrote:
this is related to issue[1]

I think it is better to make minOccurs=1 considering the following points and the issue given here[1].

1. if the type is a primitive type then anyway it get assigned a value and hence nillable=true and minOccurs=0 can not be supported. 2. if not primitive always minOccurs=0 and nillable=true maps to null value. hence nillable=true is enough.

WDYT?

[1] https://issues.apache.org/jira/browse/AXIS2-3300

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

Reply via email to