Is 'required' specified only in WSDL, as opposed to min-occur and nullable, which are XSD?
________________________________ From: Corey Puffalt [mailto:[EMAIL PROTECTED] Sent: Monday, August 20, 2007 11:54 AM To: Benson Margulies Cc: cxf-user@incubator.apache.org Subject: Re: Marking mandatory parameters with JAX-WS (was Marking optional parameters with JAX-WS) Thanks for your response. I would still need a way of overriding the default somehow for the parameters that are optional (nullable.) Corey On 8/17/07, Benson Margulies <[EMAIL PROTECTED]> wrote: Instead of thinking about 'required', concentrate on min-occurs? Aegis does this quite nicely. And if you want to set a general policy of treating zero-cardinality as evil (which I do, to avoid spurious arrays behind all the strings) you can set an option. I'm sure that there's a spring equivalent for ... DefaultTypeMappingRegistry tmr = (DefaultTypeMappingRegistry) binder.getTypeMappingRegistry(); Configuration configuration = tmr.getConfiguration(); configuration.setDefaultMinOccurs(1); configuration.setDefaultNillable(false); > -----Original Message----- > From: Daniel Kulp [mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ] > Sent: Friday, August 17, 2007 4:59 PM > To: Corey Puffalt > Cc: cxf-user@incubator.apache.org > Subject: Re: Marking mandatory parameters with JAX-WS (was Marking > optional parameters with JAX-WS) > > > Honestly, I don't think there's an easy way. I just grepped through the > JAX-WS spec and the JSR181 spec and neither spec mentions anything about > it. When we move to JAX-WS 2.1, we might be able to add support for > @XmlElement(required=true). Right now, we don't support any of the > JAXB annotations on the SEI interface methods. Some of those are > required to be supported in jaxws 2.1. XmlElement isn't one of those, > but could potentially be added. > > The only way to do it right now would be to create "wrapper" types and > use the XmlElement annotation there and use the > @RequestWrapper/@ResponseWrapper annotations to point to those types. > That should then use those types to generate the schemas and thus the > JAXB annotations should be honored. > > > Dan > > > On Friday 17 August 2007, Corey Puffalt wrote: > > Daniel, > > > > Thanks for your reply. > > > > I should have been more explicit. I am using the default DOCUMENT > > style. Furthermore, I got my question completely backwards. :P The > > real question (given that all non-primitive parameters are marked > > "minOccurs=0" as you mention below, how do I mark these parameters as > > being mandatory? (eg. minOccurs=1?) > > > > Corey > > > > On 8/17/07, Daniel Kulp <[EMAIL PROTECTED]> wrote: > > > Corey, > > > > > > On Friday 17 August 2007, Corey Puffalt wrote: > > > > I'm doing Java-first development using CXF and JAX-WS annotations > > > > and I'm trying to figure out how to mark some of my method > > > > parameters as optional (nillable). Does anyone know if this is > > > > possible? It seems like a strange oversight so I'm guessing I'm > > > > just missing something obvious. > > > > > > It kind of depends on the form of the service. I think with the > > > defaults (wrapped doc/lit), if the parameter is not a primitive, it > > > ends up with "minOccurs=0" on the element so you can send a null. > > > > > > For RPC/Lit, the WSI Basic Profile specifically prohibits sending > > > null parts with RCP/Lit: > > > R2211 An ENVELOPE described with an rpc-literal binding MUST NOT > > > have the xsi:nil attribute with a value of "1" or "true" on the part > > > accessors. > > > > > > > > > -- > > > J. Daniel Kulp > > > Principal Engineer > > > IONA > > > P: 781-902-8727 C: 508-380-7194 > > > [EMAIL PROTECTED] > > > http://www.dankulp.com/blog > > > > -- > J. Daniel Kulp > Principal Engineer > IONA > P: 781-902-8727 C: 508-380-7194 > [EMAIL PROTECTED] > http://www.dankulp.com/blog