A JAXRS sample using Apache CXF 2.5.0 and running on Heroku platform.
- Create an heroku.com account, download heroku client for your distribution, RTFM...
- From the shell, login to Heroku : 'heroku auth:login'
- Clone me then cd to cloned repository
- Create the app on heroku : 'heroku create -s cedar'
- Push the app to heroku : 'git push heroku master'
- Open the new app : 'heroku open'
I put some sample on how to use JAXRS in different situations with different needs: Check the code for details (org.chamerling.heroku.service.rest.SampleService). The list method shows a way to return JSON array using JAXB annotated classes, there are other solutions but this one is not so bad...
- http://yourapp.herokuapp.com/rest/?_wadl&_type=xml : WADL description of the service
- http://yourapp.herokuapp.com/rest/sample/ping : Returns raw pong message
- http://yourapp.herokuapp.com/rest/sample/list : Returns a JSON array
- http://yourapp.herokuapp.com/rest/sample/query?foo=bar : Returns the bar value in a bean
- http://yourapp.herokuapp.com/rest/sample/path/foo : Returns the 'foo' path paremeter
You can check a running instance at http://severe-spring-2425.herokuapp.com/