On Monday, August 29, 2011 8:58:47 AM dstainer wrote:
> Hello, I had a couple of questions about @RequestWrapper and
> @ResponseWrapper annotations with respect to CXF:
> 
> 1) For code first development, if you specify either of the wrapper
> annotations it MUST include a className, correct? I believe that's what the
> Javadoc says, looking for confirmation.

With CXF, no.   If the classname isn't there, it can use ASM to create a class 
at runtime and uses the localName/targetNamespace stuff to define the element 
and such.

> 2) The only way to control the whether an operation parameter is optional
> vs. required is using JAXB annotations within the wrapper class?

With JAX-WS/JAXB 2.1 (which is in the JDK for java6), correct.   If you 
endorse the JAXB 2.2 stuff or use Java7, you can stick the @XmlElement 
annotation on the parameter and set the required stuff there and when CXF 
generates the internal wrapper class, that annotation would be copied over.


> 3) If you want to place operation message types within a specific namespace,
> you have to use the wrapper annotations, along with the namespace
> attribute. i.e.
> 
> @RequestWrapper(localName="getNameById",
>     targetNamespace="http://www.example.com/services/order/v1.0";,
>     className="com.example.services.GetNameById"
> 
> or do you specify it in the wrapper class definition like:
> 
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "", propOrder = { "id" } )
> @XmlRootElement(name = "getNameById", namespace =
> "http://www.example.com/services/order/v1.0";)
> public class GetNameById {
> }
> 
> or in both the wrapper annotation and wrapper class definition? Are there
> ways I can reduce the amount of repetition here?

Not really, no.  :-(

Dan


> 
> Thanks
> Derek
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Some-questions-about-RequestWrapper-Respons
> eWrapper-annotations-tp4746638p4746638.html Sent from the cxf-user mailing
> list archive at Nabble.com.
-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com

Reply via email to