I'm learning to use the Google App Engine for a project.
I've created a sample web application with the java sdk, in which all the business logic is in the servlets.
Where should be right to put the business logic if I want also to expose the application functionalities through a RESTful web service (which I understood that is possible with additional framework as Restlet)?
There is any development framework that can help me in this?
Right place to put the business logic would certainly not be servlets. You should put logic in service, and data access classes. Be careful while choosing a framework on GAE as cold start may hurt badly. As for REST framework on GAE, RESTlet has gained some positive response.
Refer RESTful application on Google App Engine Java?
and Implementing REST Service (JSON) on Google AppEngine
Related
I am working on a web application developed using Play framework 2.2.4(Java) and now I need to call some SOAP web services from within my web application.
I am new to Play framework and web services and I am confused on how to do it.
So far I have only managed to used the WSDL for the SOAP services to generate the java classes using wsimport.
I came across the WS API of the play framework to asynchronously call the web services and I have the following doubts.
How can I call these SOAP services using the WS API of the play framework?
In play framework, is it necessary to use this WS API to make a web service client, or can it be done using other ways?
It would be really helpful if someone can share a small tutorial to do this.
I am new to web-services. Could someone help me in understanding the difference between REST API and a Restful web-service in java. I have developed a web-application which is based on only servlets and jsp. Now the same application has to be developed using REST API. What is the difference between developing a web app with just servlets and jsp and developing a webapp with REST API. Can someone provide links to good tutorials where I can learn more about REST API with samples.
A RESTful web API (also called a RESTful web service) is a web API implemented using HTTP and REST principles. It is a collection of resources
Reference : http://en.wikipedia.org/wiki/Representational_state_transfer
Sometimes, some organization might show little difference, Between REST API and Restful web services.
For eg, Rest API might be common for everyone to use the data with same endpoint.
Restful web services may comes with custom modification for specific requirement and endpoint will be different.
I currently have a Google App Engine app consisting of two parts:
A website using old school JSPs
A RESTful service implemented in Jersey
I've been trying to figure out how to shoehorn authentication into the web service but am rather lost since I've never used Spring before, and it sounds like that's the way to go.
Must I use Spring, or can I use Java EE? Are there any examples of how to accomplish this with Google App Engine?
Also, if I can get a high level description of some best practices for securing web services, that would be cool.
Thanks
Mark
app engine has built in OAuth support, which should do what you want.
I recomend you use apache shiro instead of spring because performance more over if you haven't got experience with spring. Apache shiro is a security framework and it could be integrated with GAE. You also can find a example in githubhow integrate the framework in GAE with Guice library.
Anyway for use Spring in GAE you also can find same best practice on Google Cloud Platform documentation
I'm researching how best to create a Restful web service on Google app engine. My end goal is to have an Android application call a web service on GAE to post and get data. At this point I not sure what the best approach is.
What I know at this point is Spring MVC 3 provide the ability to create web service but it does not provide a full implementation of JAX-RS. I also have read a few blog that talk about how Spring and Restlet can be integrated together. On the other side I have read that I could only use Restlet in GAE. I would also like provide a light web interface for users to view their posted data
So my questions are the following.
1. Should I just use Restlet.
2. Should I just use Spring MVC to provide my Restful web service.
3. Should I use Spring and Restlet together.
At this point I think I should invest my time in Restlet because that seems to be the best approach for calling web services in Android. I'm also debating if Spring MVC is just over kill.
Any thoughts would be helpful.
Have a look at the following similar questions:
Easiest frameworks to implement Java REST web services and Can anyone recommend a Java web framework that is based on MVC and supports REST?
I recently set up RESTlet on GAE and it was an absolute breeze! There are docs outlining the procedure on the RESTlet website and I was up and running RESTlet on GAE using the Google datastore within two hours.
The major downside is that performance of the Google data store for low volume apps is atrocious. Timeouts are not uncommon. (Google mandates a maximum 30 second request time and your app can easily take up half of that in coming out of hibernation if it hasn't been accessed recently)
Right now I am building another RESTful app and chose to go the Spring 3 MVC / Hibernate / MYSQL route. I am not new to Spring DI or MySQL, but I am new to Spring MVC and it is taking me days to work through all the issues I am encountering. I am disappointed in the quality of available documentation and I have not been able to find a reasonable and complete Spring 3 MVC RESTful CRUD tutorial anywhere. Argh.
I don't have experience with Restlet but Spring MVC 3.0 is quite powerful for building restful webservice AND webapps. So if you also plan for your service to be accessible through browsers then it is a great solution since your controllers can serve both apps and browsers.
Perhaps this is also possible with Restlet but I have not heard of its capabilities for building webapps.
Just beware that Spring has a high loading time. This means that you have to be careful to avoid slow responses from cold starts.
I'm trying to create a simple web service application where I can retrieve a collection of strings and store them into a data store on the AppEngine server.
I have knowledge in Java and barely any knowledge of Java Servlets and its WAR standards.
I would like to at least have some direction on how to create a web service using the Java technology AppEngine provides. I've searched but the articles are sparse and too lengthy while not providing any simple solutions.
I'd love it if I can create a web service using Java's annotations just like you can do in .NET with attributes.
I'd appreciate links to articles and guidance a full source answer is not required but would be appreciated.
No python based answers please.
IMO, there is no simple solution to build a Web Service on GAE with Java.
But, it's still achievable. Let's start with the Web Services we want to build.
In common usage the term refers to
clients and servers that communicate
over the Hypertext Transfer Protocol
(HTTP) protocol used on the web. Such
services tend to fall into one of two
camps: Big Web Services and
RESTful Web Services.
"Big Web Services" use SOAP/RPC format and RESTful Web Services use REST style one. You can read more about SOAP vs REST.
There are lots of Java open source Web Services frameworks out there. Most of them are generally based on the Java API for XML Web Services (JAX-WS), part of the Java EE platform.
JAX-WS is not supported by Google App Engine as specified in the list Will it play in App Engine. So forget about the "cool Java's annotations".
But, Restlet seems compatible with GAE. So if you think REST could be an option for you, I would go ahead and take a look at the Hello World tutorial of Restlet. Then, I'd go ahead and read the article on how to integrate Restlet with GAE.