Posts

Image
Restful Web Services in Java using Jersey JAX-RS-(RESTful Web Services ) is the Java API for creating REST web services. JAX-RS uses annotations to simplify the development and deployment of web services. JAX-RS is part of JDK, so you don’t need to include anything to use it’s annotations. Some of the important JAX-RS annotations are: @Path: used to specify the relative path of class and methods. We can get the URI of a webservice by scanning the Path annotation value. @GET.@PUT,@POST,@DELETE and @HEAD: used to specify the HTTP request type for a method. @Produces,@Consumes: used to specify the request and response types. @Consumes( MediaType. APPLICATION_JSON ) The method accepts JSON element. @Produces( MediaType. APPLICATION_JSON ) The method returns JSON element. @PathParam: used to bind the method parameter to path value by parsing it. Restful Web Services and SOAP: SOAP is a protocol whereas REST is an architectural styl