An introduction to RESTful web services and JAX-RS
RESTful web services are very flexible. They can consume several types of different MIME types, although they are typically written to consume and/or produce XML or JSON (JavaScript Object Notation).
Web services must support one or more of the following four HTTP methods:
- GET - By convention, a
GETrequest is used to retrieve an existing resource - POST - By convention, a
POSTrequest is used to update an existing resource - PUT - By convention, a
PUTrequest is used to create a new resource - DELETE - By convention, a
DELETErequest is used to delete an existing resource
We develop a RESTful web service with JAX-RS by creating a class with annotated methods that are invoked when our web service receives one of the above HTTP requests. Once we have developed and deployed our RESTful web service, we need to develop a client that will send requests to our service. JAX-RS includes a standard client-side API that we can use to develop RESTful web service...