On Tuesday 02 December 2008 5:01:01 am huntc wrote: > dkulp wrote: > > Unfortunately, this is completely per spec and there isn't any way to > > control this right now. > > Hi Daniel, > > Are you able to enlighten me as to the rationale behind the spec or point > me in the direction of an explanation? Having minOccurs="0" for objects is > not intuitive to me.
The basic reason is that if you have a method in your SEI like: String echoString(String in) and you invoke that with: port.echoString(null) How is that mapped? There are three approaches: 1) Map to minOccurs=0 2) Map to nillable=true 3) Don't map and throw an exception The spec opted for the first approach. Any object that could be null is mapped to minOccurs=0. This is partially for performance reasons. With minOccurs=0, nothing is written on the wire. The messages are smaller and thus faster. With nillable, it still has to write the element, define the xsi namespace, add the nill=true attribute, etc.... A bit more to send and parse. On a side note: RPC/Lit goes to #3, but that is because RCP accessor elements must be there and are also not allowed to have nill=true attributes. WSI-BasicProfile specifically states that RCP/Lit parts are not allowed to be nill. -- Daniel Kulp [EMAIL PROTECTED] http://dankulp.com/blog
