I am preparing an application which is console based and the outcome of the application is a RDF/XML file which contains data of all my connections from LinkedIn. Now the problem is that my entire application is console based and I need to have a REST API so as to incorporate with my application.
I am not aware of REST API's and how to use it with JAVA but can easily get through the documentation and understand it. My applications use the REST API of LinkedIn.
So can you please suggest some of the good REST API for Java?
If you're considering hosting your Java code in a cloud, Raimme Platform gives you a good opportunity to expose a REST API endpoint with just one annotation.
Let's say you have a database object/table called
my.app.Customer
, and you want to create an endpoint for returning all customers that match a certain name. In Raimme, you would achieve this as follows:You can find out more here: http://raimme.com/devcenter?questionId=1cg000000000g
Quick code example:
1) Add the javax.ws.rs dependency in your pom (if using Maven) or download it.
2) Create an empty class to define the path of your service; for example for hearing at
application/service/rest
would be3) Create the controller of your api. For example if we need these calls:
application/service/rest/resource/{id}
a simple code would be:4) If we want to specify a JSON response be sure you have the getters for your resource and type:
JAX-RS is the standard Java API for RESTful web services. Jersey is the reference implementation for this, it has server-side as well as client-side APIs (so, ways to expose methods in your code as RESTful web services, as well as ways to talk to RESTful web services running elsewhere).
There are also other implementations of JAX-RS, for example Apache CXF and JBoss RESTEasy.