This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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?
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!