0

When i am returning response in my code i am getting it as 406 Not acceptable .

M using apache wink 1.x, jdk 7, tomcat 7. I am able to return a string when the type is "application/json", but not able to return json object as weel as response

1 Answers1

0

This returns Json response back if not explicitly requested in header.

@Produces({"application/json", "application/xml" })
public Response retrieve(){
BookingType booking ;
 //create booking where BookingType can be a POJO(annotated) or JAXB object. 
return Response.ok(booking).build();
}
jerry
  • 253
  • 1
  • 2
  • 6