Want to learn to build a simple java rest server [closed] - java

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Hello people of the world!
I'm an Android developer and so far I've worked only on the client side. My next project is in need of a server to communicate with and I wanna try to build it myself.
Can someone give me direction to a good source of learning how to build a nice, small and simple Java restful server?
I've looked around, there is way too much info out there and it's confusing. Maybe one of you was in my shoes already and know a good source for it?

First of all you should read up on and learn how to use Jersey. This is the best implementation of JAX-RS API (REST for Java).
You will also need a good HTTP server and Java Servlet container. For that I'd advise you to use Jetty. Here are a few good tutorials:
Crunchify: Build RESTful Service in Java using JAX-RS and Jersey (Celsius to Fahrenheit & Fahrenheit to Celsius)
Vogella: REST with Java (JAX-RS) using Jersey - Tutorial
You asked for a "simple server", however if you're looking for high performance then read this tutorial:
Javarants: Using JAX-RS with Protocol Buffers for high-performance REST APIs, and use the Grizzly container instead of Jetty:

If you intend to build a simple server with sockets, you could try:
this SO thread for starters.
this interesting tutorial about sockets, and
the official Oracle page about sockets.
Edit this doesn't cover the "restful" side of your question though.

I just went trough this myself creating a Java server with Android client.
And this two links provided plenty of info!
a tip is to search for Java Socket server.
to learn JavaSocket
I use http://docs.oracle.com/javase/tutorial/networking/sockets/clientServer.html
And to pull it all togheter with Android client and ServerSide.
http://myandroidsolutions.blogspot.se/2012/07/android-tcp-connection-tutorial.html
Don't forgett to open ports in ur firewall to get the communication to work! to add Internet support in ur Android Manifest!

Related

Best practice solution to create a Web Service for an Android app [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I am planning to write a Web Service in Java which connects to a MySQL Database and computes and exposes different information from it.
Then an Android app will connect to this Web Service and process the information.
Initially I thought of using XML files, but I was advised that it is not the best-practice correct way, and the Service part will not be light weight. That I should use JSON.
What is the correct architecture and solution for my problem ?
Also is it possible to run a Java Web Service without Tomcat, directly by the JVM from a jar?
Any documentation or links would be helpful.
yes, for android its better to use JSON, its native API (built in)
and its much lighter.
also , its recommended to use RESTful service, for the same reasons (performance, lighter )
regarding the webservice without tomcat, i am not sure its possible, because you always need a container to manage and run your code.
here is a good tutorial to create RESTful service using Jersy.
http://www.vogella.com/tutorials/REST/article.html
the sample shows data as XML, you can change to JSON.
You can use node.js. This will not require Tomcat or any other application server since it itself hots a HTTP server in itself.
https://blog.nodejitsu.com/a-simple-webservice-in-nodejs/
MySQL with Node.js

What Java Web framework to choose? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Please help me to choose the most suitable Web framework for me and for the task I have to deal with.
The task: develop customer relationship management Web application for small and medium business with good performance.
Server side:
I'm an expert in Java, have never written anything on Groovy or Scala. Also, I have some experience in JSF (IBM portlets). The application server will be Tomcat, but we can switch to some other free server, if necessary.
Client side:
I used to create custom widgets with Dojo for developing rich Web applications. So, I call the server side with an XmlHttpRequest (dojo.xhrGet), on the server side I pack data into JSON, and then on the client side I deal with this JSON data inside my widgets. Debugging widgets takes rather much time. So, if there were something more developer-friendly (running with the same performance, that's important), that would nice.
Please advise.
As far as I know, you should choose the technology bringing less risks for you. If you consider yourself proficient with a JSF-Dojo combination, and have no non-functional requirements on the framework you must use... then use it.
Take profit of your know-how at work, then go home and spend some hours learning new technologies and acquiring new know-how on some technologies that make you feel curious :)
There is no such thing as "The Java Web framework to choose". The framework you choose depends on many factors like:
Use case
Technical requirements
(Organization) standards
Performance
Extendibility
Community & support
...
Because of it, this question cannot be answered. There are simply too many factors and too many frameworks that will apply.

Web service using php soap server and java client [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I want to learn to implement web services using soap in php. I also want to utilize the service using java client. I am interested in soap protocol and if there is some othere better protocol.
My research: I got many online tutorials on implementing web service using soap in php. I also got greate content on soap protocol.
My question: How to utilize that service using java client? Is it possible? Can you refer me to tutorial which serves my need? Is there any good book that i can purchase. I also want to know how can a php soap server authenticate a java client. Is authentication done for each request or maintaining session is possible.
By definition:
Web Services have been designed to support interoperable Machine to
Machine interaction over a network.
So consuming a web service is independent of the implementation technology of the web service, now you can search for "implement a Java based SOAP client" on SO.
plus check below URLs:
Java Client – PHP Soapserver
And THIS free book by Nan-Chao Huang.

Recommended open source workflow engine in java for non-business kind scenarios [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
My use case is not to model a business process workflow. I need a simple, easy to use and low learning curve workflow engine where I can model a simple workflow. I have a bunch of backend processes and each process needs to wait for the completion of previous process and also look at its status.
I see a whole bunch here but can't decide which one to use!
http://java-source.net/open-source/workflow-engines
thanks
You can use WSO2 Carbon Studio to model the workflow using the BPEL editor, then deploy the artefact in WSO2 BPS or Apache ODE.
You can use Eclipse Helios with WSO2 Carbon Studio 1.0.14
You can find a tutorial here.
Also this article explains a similar workflow which you have mentioned in the question.
The three most visible/active, in alphabetical order:
http://www.activiti.org/
http://www.bonitasoft.com
http://www.jboss.org/jbpm
I'd suggest going through the tutorial/quickstart of each of them to get acquainted.
Check out WSO2 Products
(source: wso2.org)
http://wso2.org/library/brs
http://wso2.org/library/bps
Imixs Workflow is an open source Java Enterprise workflow engine.
With the sub project Imixs Workflow Script you have an easy way to start with a workflow application based on JavaScript and jQuery.

Good tools/frameworks to develop a game server in Java? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am making a game server for a turn based game. Not a web based server, but a process-based one. I want it to be scalable and I want the development process to go as smoothly as possible. I haven't used Java in forever and I need to brush up on my skills, so I really have no idea what is out there framework or tool-wise. Right now it looks like I am going to use Terracotta due to its clustering capabilities. I was just wondering if anything besides this that would make developing a TCP based game server easier?
You might want to take a look at Project Darkstar.
Have a look at Marauroa. It is a client server framework for turn based games. There is even a MORPG based on it, with the turn time set down to only 300ms.
But it is not designed for cluster support.
http://arianne.sf.net/wiki/index.php/Marauroa
Have you looked at SmartFoxServer? It's Java and already supports Terracotta.
Shameless plug: Here is a java game server written by me. Has UDP and TCP support. jetserver also has a java client as well as flash action script client already developed. Clustering is not yet implemented.

Categories