Showing posts with label apache cxf REST. Show all posts
Showing posts with label apache cxf REST. Show all posts

Friday, October 21, 2011

CXF Rest service learnings

Things I learned while developing a CXF REST service


Use the @Encoded annotation to preserve characters like "+".  I had a situation where I needed to support the "+" character as an argument in a REST service. 

Below is a contrived example of what I mean:
@GET
public String getCustomer(@QueryParam("searchString") String searchString)
If you needed to pass a "+" to this method, it will get converted to a space character.  To over come this behavior use
@GET
public String getCustomer(@Encoded @QueryParam("searchString") String searchString)