Jersey 2 Restful (JAX-RS) Tutorial

Jersey 2 Restful(JAX-RS) Tutorial explains step by step details of Creating / Developing Java rest Web services using Jersey and Eclipse

JAX-RS is Java API for RESTful Webservices which is very rely upon Representational State Transfer model, you can view JAX-RS specification 

Jersey framework is more than the JAX-RS Reference Implementation. Jersey provides it’s own API that extend the JAX-RS toolkit with additional features and utilities to further simplify RESTful service and client development. Jersey also exposes numerous extension SPIs so that developers may extend Jersey to best suit their needs

Reference -> https://jersey.java.net

You can see the below example, which is demonstrating How to create a Restful service using Jersey 2

Spring MVC 4 REST Example

Spring MVC 4 REST Example explains about creating a simple Spring MVC REST service using eclipse.

In this example we are using Jackson JSON API for returning JSON response according to the request

Now a days more and more deployment is going based on restful services compare to WSDL Webservices, due to the weights towards the simplicity of configuration

You can see the below example, which is demonstrating How to create a Spring Restful service using MVC 4

SoapUI Tutorial For Testing Web Service ( REST & SOAP)

SoapUI Tutorial For Testing Web Service ( REST & SOAP) explains about testing a web service (SOAP based & REST based) using soapUI testing tool

soapUI is a testing tool used for different types of tests, such as functional testing, regression testing, compliance testing, and load testing

soapUI is a cross platform tool, Here we are using soapUI for testing various webservices, By using soapUI you can test both REST and SOAP services

Download Text File Using CXF REST / JAX-RS

Download Text File Using CXF REST / JAX-RS explains about downloading an text file using CXF REST / JAX-RS API

@Produces("text/plain")

On the above annotation, we are mapping the response as text/plain mime type, you can change mime type according to different file formats

response.header("Content-Disposition", "attachment; filename=test.txt");

We are also setting header as "Content-Disposition" in order to open file as an attachment

Download Image File Using CXF REST / JAX-RS

Download Image File Using CXF REST / JAX-RS explains about downloading an Image file using CXF REST / JAX-RS API

@Produces("image/png")

On the above annotation, we are mapping the response as image/png mime type, you can change mime type according to different file formats

response.header("Content-Disposition", "attachment; filename=test.png");

We are also setting header as "Content-Disposition" in order to open file as an attachment

Download Excel File Using CXF REST / JAX-RS

Download Excel File Using CXF REST / JAX-RS explains about downloading Microsoft Excel file using CXF REST / JAX-RS API

@Produces("application/vnd.ms-excel")

On the above annotation, we are mapping the response as application/vnd.ms-excel mime type, you can change mime type according to different file formats

response.header("Content-Disposition", "attachment; filename=test.xls");

We are also setting header as "Content-Disposition" in order to open file as an attachment

Download DOC File Using CXF REST / JAX-RS

Download Doc File Using CXF REST / JAX-RS explains about downloading a Microsoft Word Document using CXF REST / JAX-RS API

@Produces("application/msword")

On the above annotation, we are mapping the response as application/msword mime type, you can change mime type according to different file formats

response.header("Content-Disposition", "attachment; filename=test.doc");

We are also setting header as "Content-Disposition" in order to open file as an attachment

Download PDF File Using CXF REST / JAX-RS

Download PDF File Using CXF REST / JAX-RS explains about downloading PDF file using CXF REST / JAX-RS API

@Produces("application/pdf")

On the above annotation, we are mapping the response as PDF mime type, you can change mime type according to different file formats

response.header("Content-Disposition", "attachment; filename=test.pdf");

We are also setting header as "Content-Disposition" in order to open file as an attachment