First sorry for my english. I am currently trying to develop a JAVA webservice for Android devices. More precisely, the webservice provider would be an ordinary computer and webservices clients would be Android devices.
After I have read some tutorials, I have done this one (webservice + client), which require only Eclipse. Everything works OK. So my question is the following: given that my webservice is working well and is accessible, why would I use soap engine and application server, as mentionned in this short introduction to webservice ? Said another way, what are the advantages, concretely?
I have tried to google, read and learn more, but I am stuck at this point.. If I have well-understood, SOAP engines, like Apache AXIS, allow to dynamically generate SOAP data and to receive requests from different clients. But does not my webservice already generate automatically SOAP requests/responses, since I can use my webservice with my dedicated client?
Regarding application server, I just can't figure out what it is. I found few documentation about that I could understand.
I know that instead of asking these kind of question, a better way would be to practice myself soap engine and application server, but I would prefer to know what I am doing and using rather than to go in a "random mode".
I hope I've been clear, thanks a lot for you answers.
MCFarah
You asked a couple of questions which are quite heavy, but i'll try to give a brief overview:
Web/Application Servers are basically a piece of program that implements a lot of stuff that help the developer, by allowing him to focus on the actual development and not on the stuff around. Stuff like: Threads, security, Database connection pooling etc.
You don't have to use SOAP webservice, actually I think you'd be better off using REST.
The tutorial you did is a "Hello World" tutorial. It is only good for getting started but once you start writing a larger application you would want to use a web server. Id recommend starting with Tomcat.
Just start using the technologies and post questions as you go.
Related
I have been doing research for days and am so lost because everyone implements this differently or these tutorials are unclear.
I will be writing a web application that uses API's from sites like AWS, CROWD, etc. to create a single-sign on portal to manage many different things.
I have never worked in web development before, so this is all new. How should I get started in this project? What exact files will I need to create? Any advice would be helpful.
The only constraints that I have been given is that this will run in Tomcat, so I need to use java.
You need to understand the basics of client - server architecture and develop a
web service to standardize the REST based actions such as RPC.
I tried to understand this several times allready, but still have not found out how this should be done.
I want to create a web interface for some existing console or swing application. Something like the web interface SABNzb offers (I know, it's Python – it's just an example).
I have looked at several technologies allready, like creating web services using a tomcat server, or java server pages/faces, but all the tutorials that I found so far start with "Create a new Web Project..." at wich point I stop because this is not what I want! I have a finished an application in which I want to integrate a web interface, not some web service that instantiates my program as a local variable and uses its code. So basicaly it feels like all the tutorials I find are the wrong way around.
The core procedure of this is clear, the application should listen for http requests on a port I choose and answer with a created html code to it. So basicaly I could open a port using a socket and write an html page to its output on connect. But this rather feels like inventing the wheel all over again, also I'm not sure how an interactive web page would work this way.
Maybe I am thinking somewhat strange here or did not understand how some of these things work, but I am pretty unexperienced with web technologies, so grasping the concept is rather hard at the moment. Can anyone point me to a tutorial that shows how this might be done, or some other source of information on it?
You don't need JSP or JSF; all you need is a servlet. It's an HTTP listener class. You can do REST with that.
The moment you say that you have to deploy your servlet in a WAR on a servlet/JSP engine. Tomcat is a good choice.
Google for a servlet tutorial and you'll be on your way.
My First Tomcat Servlet
Ok, thanks to duffymos answer and comments i realized i was actualy searching with the wrong keywords.
Embedded web server is the thing i was looking for.
Like Simple or build in HTTPServer class in java.
I'm attempting to write a browser based MMO using libGDX and it's HTML5/GWT port and I have no idea how to do the client/server interactions. I have already written the application for desktop as a sort of "learning" project for myself, and have now decided to rewrite it into the browser.
I have never done browser development before, so I'm not quite sure of how to go about doing the networking portion of the project. I fear that this is because I'm not quite sure as to how GWT actually works, especially when being used for what I'm doing. I attempted to use a library called KryoNet for the networking but apparently you cannot use normal networking methods for GWT. I received this error: http://pastebin.com/DVJPA44N
In short, I need help/direction with how to do a client/server communications type deal with GWT if it's even possible. If there is an easy google answer I apologize, I'm not sure how to word what I'm looking for.
Thank you!
EDIT: I looked at the WebSockets API, and that's not quite what I'm looking for. I want to host a server locally off the desktop and communicate to the client hosted in the browser. I apologize if I'm just misunderstanding the whole servlet setup in GWT.
Did you have look at something like PlayN ( Angry Birds is top example using it with GWT for Browser port of the application )
Also you need to checkout WebSocket API ( either direct use in GWT/JSNI or via third-party gwt jar )
This is a very beginner question. I have tried to search for advice but am overwhelmed by the amount of information and would like some help with ideas on approaches to server design or what to search for!
What I would like to set up is a backend server that provides search capabilities and business logic and validation across some fairly basic data. It wont get too large.
I would then like to be able to plug in a website as a front end or a mobile app or a facebook app or even a desktop app..
My question is what is the best way for front ends to hook into the backend? I would like to have various user accounts with permission levels so authorisation would be important.
I generally only code as a hobby so whilst technically I have built a spring based website before the exact semantics of the client server relationship weren't clear to me. Now I want to separate the backend so that is is agnostic of how the data is displayed or entered completely and can run on a separate machine.
Thanks,
Rob
There is a ton on options. I had good expirience with apache CXF rest services (logic encapsulated in java beans, spring configuration) and pico web remoting ( more exotic,
but also rest service and plain java objects providing business logic)
if you ar already using spring, I would recommend to stick with CXF - it integtrates seamlesly ( and is spring configured itself )
I was looking for some opinions on the best remote method invocation practices when developing iPhone applications that communicate with Java (java EE) servers.
Many iphone applications these days typically talk to a server back end. I typically prefer to write my servers in java using some Spring libraries. So far I have not found or stuck to a definitive practice for iphone->java server communication.
What are some technical solutions and libraries that you have used to implement this kind of client-server communication?
One thing I always keep in mind is that I want the communication protocols to be simple so that multiple platforms can be added for example, in future adding Android and possibly Blackberry clients, that can use the same protocol to talk to the server.
I'd go with JSON. If you want to use Spring, go with restful webservices. Do some googling on "webservices restful spring json" (without the quotes) and you'll get some pointers.
JSON will suit you fine with other languages as well. I've written an iPhone application that uses JSON, and that was quite easy with the use of
http://code.google.com/p/json-framework. I'm pretty sure that both Android and Blackberry should be capable of reading JSON just fine as well.
Edit: I forgot to mention that I have put this iPhone application under an MIT license and you can browse the code on google code:
http://code.google.com/p/accountadmin/source/browse/#svn%2Ftrunk%2Fiphone%2FFrittRegnskap%2FClasses
I'm currently doing this for work as well. Our backend is Java EE (with Spring) and then of course the front end is iOS. We use JSON as the payload format, as Knubo suggested. All of our web services are also RESTful to make dealing with URL construction and authentication on the phone easier.
I would highly recommend you check out RestKit, which is a pretty comprehensive framework that allows you to easily integrate your RESTful, JSON-based web services with CoreData. We also use YAJL for parsing JSON manually in the rare cases where that is necessary.
Thus far, that tooling has made it a breeze to work with our web services.
http://code.google.com/p/json-framework is really useful.