I coded a webservice rest which works.
I implement various methods which return some info in JSON format but one method returns me info in XML. I added :
produces="application/json"
in the @RequestMapping of that method. Now It returns me a JSON data, but it’s not contains all of info which XML response contains.
Try using the @Responsebody annotation, which indicates that the return type should be written straight to the HTTP response body. If you need to convert objects to JSON I would recommend using Jackson Json Parser, Spring will not automatically produce your response in JSON you need to serialize the response to JSON by yourself or using another framework.
Spring Docs: http://static.springsource.org/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-ann-responsebody