I have created an App Engine service that exposes a REST api. I created that with the Cloud Endpoint framework. One thing that this framework gives me is a java library that I for example can use in my Android app. That works fine.
What I want to do now is to add some testing of the endpoint. I would like to use the generated library to make calls to a running server. The Gradle App Engine plugin already support this by a build step called FunctionalTests. The only problem I have is that I have no idea how to access the generated library classes from my test. Anybody has done something like this?
Related
I'm trying to implement a REST API with JAX-RS using to deploy it in Liferay 7.2 and consume it with a React JS application as the font-end .
Until now I don't know how to create a good project structure to start my back-end project!
My Rest API is connected to a two tables database, how can I add them to the project? and where I have to work in the project to create my controllers and application's business logic?
I tried to create a project and it looks like this for now.
Thank you!
It looks like you created a Liferay service-builder project. No need to do that as you are not building any Liferay services. Start with a Liferay rest project. This will automatically create the necessary files for a JAX-RS application.
I'm a beginner in context of google-cloud-endpoints and the associated product "google-cloud-app-engine".
I've created a simple google app angine project/application and created an API-Key by using the google cloud platform's console.
To my app-engine's endpoints API definition I've added the annotation
"apiKeyRequired = AnnotationBoolean.TRUE" as stated in
Add API restriction by adding an API key to your app engine application
and my client application which uses the generated endpoints client API was also updated accordingly to send the generated API key for all API requests.
As I would like to test the "API-Key" mechanism locally on my development machine (using a local app-engine environment) before deploying the backend to the cloud, I would like to know, whether it is possible to test the "API-Key"-restrictions locally. I mean, somehow the locally executed app-engine backend app has to be aware of the created API key. Maybe there is a property which I have to provide to my app-engine backend application's POM.xml file...I don't know, whether the google app-engine SDK supports API keys for local testing in context of the "endpoints framework v2" actually. The newley introduced API Management Platform (API-Gateway) can maybe not be "simulated" locally...?!
Thank you so far for your effort!
API key restrictions should work locally. You just need to include GoogleAppEngineControlFilter in your web.xml.
I want to run and deploy a java rest API code on Bluemix. This is more to understand the Devops capabilities in conjunction with API management.
I tried to use this: http://www.codingpedia.org/ama/tutorial-rest-api-design-and-implementation-in-java-with-jersey-and-spring/
But could not push it to Bluemix. May I get some support?
Update:
When I push it to Bluemix, I get an error saying it could not find appropriate runtime.
Reading your comments you are searching for some pointers to create a starter Java REST application (possibly integrating a delivery pipeline).
You can start creating an application on Bluemix using the Liberty for Java runtime. Then you can, from your application dashboard, click on "Add Git" to create a Git repository on IBM Bluemix DevOps Services (IDS). Now you have your starter application running on Bluemix and its code hosted on IDS. You can edit the code directly on the Web IDE of IDS (clicking on "Edit Code") and from there push the new versions of the applcation on Bluemix or you can clone the repository on your local environment (for example using the Eclipse Tools for Bluemix) and deploy directly from your machine to Bluemix.
Using the first option you will be able to quickly setup a delivery pipeline using the "Build & Deploy" button, and use the DevOps capabilities of IDS. The Build & Deploy feature, also known as the pipeline, automates the continuous deployment of your projects. In a project's pipeline, sequences of stages retrieve input and run jobs, such as builds, tests, and deployments.
To add REST capabilities to the sample application you can for example use JAX-RS 2.0. Take a look here.
Javaee jax-rs REST API starter
Use my java REST API starter for bluemix. This uses javaee + jax-rs + swagger
Just fork it, run pom.xml to generate war and push the war file to bluemix. Works like a charm
https://github.com/sanketsw/jax_rs_REST_Example
Spring boot REST API starter for bluemix
if you want a spring boot REST API starter, you can use the following boilerplate. This is a netflix eureka client but you can ignore eureka annotations. The REST API will work seamlessly anyway
https://github.com/sanketsw/Netflix_Eureka_Client_Hello_World
Another cleaner springboot REST API starter is here: https://github.com/sanketsw/SpringBoot_REST_API
I have existing appengine application. I'm planning to develop android application with that existing app. I can only find examples on development of android app w/ new appengine application. Any reference for developing android app for existing appengine project?
There is nothing special about it. You have to add some sort of an API that your mobile apps can use and return data in an easily parsaeble format such as JSON or XML. You have think about whether you need authentication and how to do it (Google accounts are integrated in Android, but you need extra permissions to use them). Then you access them from Android using HttpClient or HTTPUrlConnection.
The 'new' way to do it would be to use Goggle Cloud Endpoints which takes care of authentication and generates an Android client for you automatically. However it is still in
'trusted beta', so you might not be able to use it.
http://endpoints-trusted-tester.appspot.com/
I am a newbie to Android platform.
I want to call a webservice from android java development enviornment. Am using axis technology to connect to a webservice in java development.
Can i use the same technology here in android development also.?
one more doubt am having is am using several jar files (like axis,commons-logging,commons-httpclient) in java dev enviornment for webservice call and its implementations.
Can i use these jar files in android java dev platform.?
Experts please give me a clear idea about all these..??
if your web service is SOAP you can use KSOAP2, it enables you communicate easily with SOAP web service. if your web service is REST you can then use classes like HttpClient, HttpGet and HttpPost that exist already on Android.
Your question has already been asked here.
It isn't possible to use Axis or some other framework as is with Android. You will have to recompile all jars with Android SDK in order to do so.