Oracle has put together a number of excellent tutorials on creating RESTful web services (in both NetBeans and Eclipse). This is part 1 :
In part 2 the tutorial implements a way for the RESTful web services uses CRUD operations :
In this tutorial you build – a client app to consume RESTful web services, generate entity classes from a database, create/update/delete/retrieve operations.
In the final tutorial (part 3), Developing an Ajax Client for RESTful Web Services in NetBeans 7 an AJAX client is developed to consume RESTful web services, rendering RESTful response in both XML and JSON formats.