I like to implement server as backend server service and front as a regular website using php..Is it possible to create like this.Also how can integrate this by using a java swing application as client (client is on localhost)?
You may use web services. So you can create server in php and client in java.
Related
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.
Mike, You will have to host your service on some server. Build a WAR file and deploy it on to a hosting server. Then you can call your API with the designated IP or masked name instead of localhost:8080 which I presume you are using. Also, I would recommend using a Jersy client.
I have been looking into the Azure Service Fabric development and I have successfully created some test HTTP Stateless-Service applications in Java. Now I'd like to use encrypted api server communication in form of HTTPS but I cannot find any information how such server could be set up in Service Fabric environment.
In my HTTP applications I have been using com.sun.net.httpserver.HttpServer class and when I checked into the HttpsServer class I could not figure out how I could get the certificate saved into the application so that it could be used with the HttpsServer class. All the example applications using HttpsServer seem to read the certificate file from disk and that is not possible in ServiceFabric environment as far as I know.
So what is the proper way to set up HTTPS server in Java Service Fabric Stateless-Service application?
You can deploy certificates to cluster nodes using the ARM template.
Alternatively:
You can also use dotnet core and Kestrel for this. Here are some links to get started.
Github
Channel9 Video
Blog
You can also choose to run a web server like NodeJS or Flask as a container on Service Fabric.
I have been looking at tutorials like this, java websockets using Tyrus and I see a server implementation, a java client, and a javascript client. I was expecting only a server implementation and a javascript client to handle messages from the server. Why is there a java client? If I am running my application with a browser then do I skip the Java client?
Yes. It's just an example, they could have Ruby, Python and C clients too. It just shows that it's not limited to only Javascript clients.
I am working client -server architecture, i need to install one fingerprint device in client side, then i need to run some application in client side using server side to get the fingerprint image from client to server which has taken from the client side.I am planning like, applets are client sides and jsp are at server sides.please help me out.
Your design looks fine to me, but what is the exact issue that you are facing.
From the Applet you need to call a servlet by using some API like Apache HttpClient.
http://hc.apache.org/httpclient-3.x/
You can then use the response of the Http call in your client (Applet).
We have a server written in java, and an application written in phonegap for the android with javascript.
How can we transfer and receive information from the application to the server?
We've tried using DWR to no avail, as the html file is on the android, so we can't call methods on the server.
Is there anyway around it so we can use DWR or another method to contact the server?
Thanks
We transfer and receive information by using AJAX calls and jQuery, and setting the server headers correctly (i.e., setting "Access-Control-Allow-Origin" to "*"). This allows any client to make cross-domain AJAX calls.