You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Corey Puffalt <cp...@gmail.com> on 2007/08/17 17:28:03 UTC
Marking optional parameters with JAX-WS
All...
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.
Thanks,
Corey
Re: Marking optional parameters with JAX-WS
Posted by Daniel Kulp <dk...@apache.org>.
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
daniel.kulp@iona.com
http://www.dankulp.com/blog