google-cloud-endpoints

Passing list of boxed primitives to Google Cloud Endpoint

孤人 提交于 2019-12-01 12:07:27
I am struggling with Lists as method parameters at Google Cloud Endpoints. The documentations says that The supported parameter types are the following: java.util.Collection of a parameter type I tried to do it this way, but it just do not work. Basic endpoint method: @ApiMethod(name = "testMethod", httpMethod = HttpMethod.POST) public void testMethod(@Named("longList") List<Long> longList) { for (Long aLong : longList) { if (aLong < 5) { throw new IllegalArgumentException("You can't do it"); } } } When I execute this method using API Exploler the generated URL is: POST http://localhost:8080/

Objectify with Endpoints for android

心不动则不痛 提交于 2019-12-01 11:39:00
问题 I read that Objectify is a supported framework for use with Endpoints. How do I convert the sample from the GPE App Engine Connected Android Project wizard to deal with Objectify 4 data? I'm getting this: org.datanucleus.exceptions.ClassNotPersistableException: The class "com.example.MyObjectifyTestInfo" is not persistable. This means that it either hasnt been enhanced, or that the enhanced version of the file is not in the CLASSPATH (or is hidden by an unenhanced version), or the Meta-Data

Passing list of boxed primitives to Google Cloud Endpoint

戏子无情 提交于 2019-12-01 09:53:02
问题 I am struggling with Lists as method parameters at Google Cloud Endpoints. The documentations says that The supported parameter types are the following: java.util.Collection of a parameter type I tried to do it this way, but it just do not work. Basic endpoint method: @ApiMethod(name = "testMethod", httpMethod = HttpMethod.POST) public void testMethod(@Named("longList") List<Long> longList) { for (Long aLong : longList) { if (aLong < 5) { throw new IllegalArgumentException("You can't do it");

Google Cloud Endpoints + Firebase Auth: method_info is not set

这一生的挚爱 提交于 2019-12-01 06:16:21
问题 So I am running the sample code provided by Google: package com.neat.backend; /** * An endpoint class we are exposing */ @Api( name = "myApi", version = "v1", namespace = @ApiNamespace( ownerDomain = "backend.neat.com", ownerName = "backend.neat.com", packagePath = "" ), issuers = { @ApiIssuer( name = "firebase", issuer = "https://securetoken.google.com/" + PROJECT_ID, jwksUri = "https://www.googleapis.com/robot/v1/metadata/x509/securetoken@system.gserviceaccount.com") }) public class

Nullpointerexception throws when inserting entity using Auto-generated Classendpoint insert method

不羁岁月 提交于 2019-12-01 04:19:30
I am confused to using auto-generated endpoint class. I want to use generated endpoint to insert new object into datastore. But, an exception is throwing. fooEndpoint.insertFoo(foo); // throws null pointer exception My entity class is similar with the given example at this source: https://developers.google.com/appengine/docs/java/datastore/jpa/overview. Here is my entity: @Entity public class Foo { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Key ID; Here is the stack trace: java.lang.NullPointerException at org.datanucleus.api.jpa.JPAEntityManager.find(JPAEntityManager.java

Cloud Endpoint parameter should not be named

若如初见. 提交于 2019-12-01 03:58:51
问题 I want send a HashMap<String, String> from JS application to my Google App. I created a HashMapContainer class such as in : Cloud Endpoints Collection Parameter. The Endpoint method is defined like this : public Entity myMethod( @Named('param1') String param1, @Nullable @Named('param2') HashMapContainer param2) { //... } When I run the API generation this error happens : com.google.api.server.spi.config.validation.ApiConfigInvalidException: Resource type 'class com.mason.server.entity

Putting a Cloud Endpoints API in a separate App Engine module

我与影子孤独终老i 提交于 2019-12-01 02:52:45
问题 I am developing an App Engine app and plan to also provide an API. I would like to separate this API from the main site, so I'm trying to use the "modules" feature to separate both apps. The main site would be the "default" module, and the API would lie in the "api" module. However, I'm having troubles with this. Right now my main app's YAML file is like this: application: my-app module: default runtime: python27 api_version: 1 ... handlers: # Root handler - url: /.* script: main.app secure:

Using AFNetworking to post both text and multiple images to Google Blobstore

天大地大妈咪最大 提交于 2019-12-01 01:09:36
For reference, here is the working android/Java version of what I am trying to do in iOS/Objective-c public static void saveTextsAndImagesOnServer(List<byte[]> images, long someID1, String servingUrl, boolean someFlag) throws ClientProtocolException, IOException { Log.d(TAG, "saveTextsAndImagesOnServer started "); HttpClient httpClient = new DefaultHttpClient(); HttpPost postRequest = new HttpPost(servingUrl); MultipartEntity reqEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE); AdditionData extr = AdditionData.getInstance(); reqEntity.addPart("red", new ByteArrayBody(("" +

Migrating to Cloud Endpoints Frameworks 2.0 for App Engine

给你一囗甜甜゛ 提交于 2019-11-30 22:42:00
I'm currently trying to migrate from Cloud Endpoints 1.0 to Cloud Endpoints Frameworks 2.0 . I've followed the steps outlined here: https://cloud.google.com/appengine/docs/java/endpoints/migrating?authuser=0 In my build.gradle I've replaced: compile 'com.google.appengine:appengine-endpoints:1.9.42' compile 'com.google.appengine:appengine-endpoints-deps:1.9.42' with: compile 'com.google.endpoints:endpoints-framework:2.0.0-beta.5' compile 'javax.inject:javax.inject:1' And in web.xml I've replaced SystemServiceServlet with EndpointsServlet and /_ah/spi/* with /_ah/api/* . However on compile, I

Generate cloud endpoint client library suddenly stopped working

♀尐吖头ヾ 提交于 2019-11-30 22:12:57
Normally when I right-click my app engine project and choose "Generate cloud endpoint client library" using the Google plugin for Eclipse, it generates the client libraries and automatically copies them into the Android client project. However, for no apparent reason, the client library is no longer being copied to the client project. In fact, it has been removed (so now I have a lot of errors in my project because it can't find the libraries). I've tried re-generating the client library which completes without any errors but the problem persists. Interestingly, it seems to complete the