I have created a RESTful web service (using jersey in Eclipse) with Postgres database access. Both are running on my local machine. I have tested the service via the Postman client application sending some requests and getting responses as JSON to ensure that my server responds appropriately, all works fine. Now I have created a GUI (client application) using Swing for the management of the server (someone sits in front of it and manages the DB content). In addition, I want to do the following:
- Start (not call) the RESTful web service from GUI (the person starts the GUI application to do his work, and with that the server starts, too, automatically). How can I do this is there any method I have to call?.
- To query the server I have found these two methods: RESTful Java client with Apache HttpClient and RESTful Java client with Jersey client. Which of them is the better one?.
The overall structure of my communication processes using an Android client (in future) will be the following: Java client with GUI -- JSON --> RESTful web server <-- Android client
Use case: An Android client sends some data (text, pictures) in JSON format to the RESTful service which saves them in the Postgres DB. The Java client reads this data and displays them onto the GUI.