I want to create to applications one written for Google App Engine (strictly Java) and the other an Android app. I want the android app to connect to the GAE server. Via what API will I get support for JAX-WS?
Google App Engine from what I've seen promotes the usage of RESTful architectural style and thus is a JAX-RS reference implementation which is pretty straightforward (annotations on WebService methods, parameters etc.)
Plus, some of the packages you need in order to marshal-unmarshal request and responses are not included
If you so insist on using JAX-WS I would suggest you take a look at this blog entry.
I would strongly advice you not to delve into a web service implementation with this approach, google app engine has already the endpoints API in order to deal with developers wanting just a backend to their apps.
Related
As I have understood we use Web services(Rest/Soap) so that a piece of code with some functionality written in one language(say Java) can be used by other programmer no matter the language(say Python) he is developing the application over the internet.
One of the projects I came across uses EWS web services to create,delete appointments on our Outlook 365. The application is developed in Java and a JAVA EWSAPI.jar file is included in the library path(which contains class files like appointment.class,Meeting.class etc) to connect to EWS server and create meetings .
My confusion is suppose we were developing the application in Python, so for that do we have another API (say EWSPython.pythonextension). So then how developing a web service helped us.
I understand API defines the set the methods available and how can they be called with argument.
Please clear my doubts.
I think that you have misunderstood the aim of webservices. We need webservices to make their calls (clients) a platform independent interface which means that once you have created your webservice using any technology (java for your case here) now anyone can call this service by creating a client using any language like python, C#, C++, Ruby, ........... in that case a service which was built by Java will be consumed or called by an application or client created using python and vice versa.
JAVA EWSAPI.jar file is a API Client Library.
What is a client library?
A client library, sometimes called a helper library, is a set of code that application developers can add to their development projects. It provides chunks of code that do the basic things an application needs to do in order to interact with the API. For example, a client library may:
Provide boiler-plate code needed to create an HTTP request and to process the HTTP response from the API.
Include classes that correspond with the elements or data types that the API expects. For example, a Java client library can return native Java objects in the response from the API.
Handle user authentication and authorisation.
How is that useful?
Looking at the developer who’s using the API: With a REST API or any web service API, the developer could be using any of a number of programming languages to make the API calls.
Wouldn’t it be great if we could give them some code in their own language, to help them get started with the API? That’s what a client library does. It helps to reduce the amount of code the application developers have to write, and ensures they’re using the API in the best supported manner.
For more information:
https://ffeathers.wordpress.com/2015/10/25/what-is-an-api-client-library/
I used GAE on and off during the last few years, mostly in Java, but looks like recent migration of GAE into "Google Cloud" left a lot of documentation, examples and tools in disarray.
I need to get brand new Backend server started for Cordova/PhoneGap based Mobile App. It naturally needs Authentication, both internal and with Google+, Facebook, etc and needs DB access naturally.
What is the Best example you recommend for backend code in open-source (GitHub or Google's own?) where Best Practices and Architecture/Design Patterns were followed.
Preferably backend should show/make use of:
Login/Authentication Session management on GAE
All RESTFul APIs with JSON
JDO or Hibernate DB interactions, with auto-schema management (on Google Cloud SQL presumably) -
Bonus points for OAuth 2.0 and Push messaging inclusion, but I know I am asking too much...
Thanks a lot!
I am exploring the possibility of using a RESTful API as the backend for an Android application.
I previously have simply been using socket programming to have my clients connect to server application but since I intend to develop a web application (with the admin functionalities for the android app) I figured this may be a good option.
My backend will be required to pull data from a nosql database and run a machine learning algorithm periodically on the data. The android app will, amongst other things, query the results of the computations and provide additional information to the algorithm.
Is it possible for me to use Spring to expose some of the application functionality through a REST API while still having other functions and tasks running in the background? Basically, can I design an application that will query multiple web services and perform various scheduled computations and query and expose only some of those functions through an API ?
Am I approaching this completely the wrong way?
Your approach sounds fine to me. Your REST API could just call internal backend methods as needed and return their output as JSON or XML formatted data.
I recommend you, if you haven't already looked at them, to go through the Spring "Getting Started" guides for building a RESTful web service and scheduling tasks.
On the Android side I'd recommend you to look into Retrofit.
I know App Engine uses the Jetty servlet container to host applications ,right now we are using Endpoint which uses the RESTful services by which mobile app(android) and web client can communicate with app engine and can perform insert update and remove operation on datastore using JDO or JPA.
This same operation can also be used if a java servlet on app engine app,it also uses JDO or JPA to communicate with data store ,
SO with app engine which is more advisable Endpoint(RESTful services) or servlet?
Any clarity on this will be really helpful.
thanks in advance!!!!!
Depends on what you want to achieve.
When you use endpoints, you can get autogenerated client-code and you can possibly end up with less boilerplate code. The endpoint code will handle all marshalling/unmarshalling of the data you send to the server. But you will also have to use the auto-generated code for all clients using the endpoint.
Using servlets you will have to do a bit more boilerplate coding and do all the marshalling yourselves, but you will have full control of what happens and you do not need to use the autogenerated code.
I'm interested in building a Google Web Toolkit (GWT) application that will run on the Google App Engine (GAE). I'd also like to expose a web service that shares the same datastore and can receive posted data from a different web application hosted elsewhere.
Would using Restlet be a good solution, or is there a simpler approach that doesn't require the use of a 3rd party library? Is there some way for the GWT client to accepted json that can then be serialised over GWT-RPC to the GAE datastore? Do I need to write a servlet that can parse and persist jsonp?
I suspect my thinking may be a bit muddled here... any assistance is appreciated!
As per http://groups.google.com/group/google-appengine-java/web/will-it-play-in-app-engine
Restlet
Version(s): 2.0 M5 +
Status: COMPATIBLE
The team has created an adaptation of Restlet just for App Engine.
See http://wiki.restlet.org/developers/172-restlet/251-restlet.html for instructions on tuning a standard installation of Restlet for App Engine.
Here's another blog post from the team about Restlet: http://blog.noelios.com/2009/04/11/restlet-in-the-cloud-with-google-app-engine/
GWT has native support for JSON, You just need a library on the server to parse/create JSON. (GWT JSON Sample)
GAE uses Servlets, so any Servlet would do if you wanted to go that route. There is nothing to say that your client needs to be GWT.
You can use the persistence JDO, JPA or Raw APIs for persistence, They are a little tricky and not that clearly documented (it is complex).
See these articles for a clear explanation and sample code:
http://www.ibm.com/developerworks/java/library/j-gaej1/
http://www.ibm.com/developerworks/java/library/j-gaej2/index.html
http://www.ibm.com/developerworks/java/library/j-gaej3.html