File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes ResponseWrapper in cxf Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "ResponseWrapper in cxf" Watch "ResponseWrapper in cxf" New topic

ResponseWrapper in cxf

pawan chopra
Ranch Hand

Joined: Jan 23, 2008
Posts: 415

Hi All,

I am using cxf in grails. In my service method I want to return status of the request (SUCCESS/FAILURE) and all the fields of new object created by that service. I have created a custom object which has all these fields and also annotated with @XmlAccessorType. I have also defined this object as a @ResponseWrapper in the service method. Now I am confused what should I return from my method? Wrapper object ? I tried returning wrapper object but I couldn't get anything in the response. Can anybody help me for this?

Pawan Chopra
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
I am not entirely familiar with web service development in Grails, but if they are adhering to JAX-WS (which I suspect), then you should not return the response wrapper, but the result from the method. The following example shows a method which adds two numbers and has a response wrapper:

The com.ivan.javax.AddResponse wrapper class will be generated by JAX-WS.
Hope this is of any help!

My free books and tutorials:
I agree. Here's the link:
subject: ResponseWrapper in cxf
It's not a secret anymore!