You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Benson Margulies <bi...@basistech.com> on 2007/10/11 02:21:22 UTC

minOccurs/nillable on a parameter

Is it my imagination, or does JAXB lack an @-nnotation to specify
nullable or minOccurs for a parameter?

 

Aegis has a mechanism, but I can't seem to get it to work, so I went
shopping for snails and I can't find a candidate.

 

@WebParam doesn't handle it, and none of the Xml... annotations are
allowed on parameters.

 

 


RE: minOccurs/nillable on a parameter

Posted by Benson Margulies <bi...@basistech.com>.
 I tried a related experiment. I modified a wsdl to have some of these
attributes on a parameter, and then ran wsdl2java. As far as I can see,
no @XmlElement specs results. Is wsdl2java supposed to produce java that
has exactly the same contract?

> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Wednesday, October 10, 2007 10:50 PM
> To: cxf-user@incubator.apache.org
> Cc: Benson Margulies
> Subject: Re: minOccurs/nillable on a parameter
> 
> On Wednesday 10 October 2007, Benson Margulies wrote:
> > Is it my imagination, or does JAXB lack an @-nnotation to specify
> > nullable or minOccurs for a parameter?
> 
> Well, yes and no...
> 
> JAXB has the ability to specify that stuff with attributes on the
> XmlElement annotation.   JAX-WS allows you to define a "wrapper" type
> that the runtime uses to for IO.   Thus, you can create the wrapper
type
> with the annotations that you want and then use the @RequestWrapper
and
> @ResponseWrapper annotations to point the JAX-WS runtime at it.
> 
> Yes, it does kind of suck.
> 
> 
> > Aegis has a mechanism, but I can't seem to get it to work, so I went
> > shopping for snails and I can't find a candidate.
> >
> >
> >
> > @WebParam doesn't handle it, and none of the Xml... annotations are
> > allowed on parameters.
> 
> With JAX-WS 2.1, SOME of the Xml.. annotations are allowed.
XmlElement
> is not one of them though.
> 
> 
> --
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727    C: 508-380-7194
> daniel.kulp@iona.com
> http://www.dankulp.com/blog

Re: minOccurs/nillable on a parameter

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday 10 October 2007, Benson Margulies wrote:
> Is it my imagination, or does JAXB lack an @-nnotation to specify
> nullable or minOccurs for a parameter?

Well, yes and no...    

JAXB has the ability to specify that stuff with attributes on the 
XmlElement annotation.   JAX-WS allows you to define a "wrapper" type 
that the runtime uses to for IO.   Thus, you can create the wrapper type 
with the annotations that you want and then use the @RequestWrapper and 
@ResponseWrapper annotations to point the JAX-WS runtime at it.   

Yes, it does kind of suck.


> Aegis has a mechanism, but I can't seem to get it to work, so I went
> shopping for snails and I can't find a candidate.
>
>
>
> @WebParam doesn't handle it, and none of the Xml... annotations are
> allowed on parameters.

With JAX-WS 2.1, SOME of the Xml.. annotations are allowed.  XmlElement 
is not one of them though.


-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog