This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "ResponseWrapper in cxf" Watch "ResponseWrapper in cxf" New topic
Author

ResponseWrapper in cxf

pawan chopra
Ranch Hand

Joined: Jan 23, 2008
Posts: 408

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
SCJP - DuMmIeS mInD
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
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: http://www.slideshare.net/krizsan
 
Don't get me started about those stupid light bulbs.
 
subject: ResponseWrapper in cxf
 
Similar Threads
Relation table
Web Service SOAP exception when security access denied.
Problem with CXF wsdl2java
Webservice deployment failed