How to run Google app engine endpoint methods from the backend

核能气质少年 提交于 2019-12-04 18:51:42

After adding the client endpoints jar file as a library, this properly warms up MyEndpoint from the Java backend:

NetHttpTransport HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();
JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance();

Myendpoint.Builder endpointBuilder = new Myendpoint.Builder(
          HTTP_TRANSPORT,
          JSON_FACTORY,
          null);

endpointBuilder.setApplicationName("My App");
Myendpoint endpoint = endpointBuilder.build();
endpoint.getMyEntity(1L).execute();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!