I don't know how much it will help, but RestyGWT could be used
for the GWT client to access JSON data via a predefined and
share-able json rest interface definition.
Then you could use the builts, (a bit manaully), of libGDX net to to http/json calls to the end point.
The end point I would think would need to be a separate project,
just use a predefined endpoint API in your clients to access it as
a 3rd party service.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
// Build API request URL.
backendMethodURLStr= "https://api-backend.appspot.com/_ah/api/endpointsApi/v1/sayHi
endpointRequestURLStr = backendMethodURLStr + "/" + URL.encode(dataStr);
// Ping Endpoint with value REST request.
RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, endpointRequestURLStr);
HttpRequestCallback httpReqClbk = new HttpRequestCallback();
try
{ builder.sendRequest(null, httpReqClbk); }
catch(RequestException exception)
{ httpReqClbk.onError(null, exception); }
[...]
class HttpRequestCallback implements RequestCallback
{
@Override
public void onResponseReceived(Request request, Response response)
{
String responseStr = response.getText();
log("HtmlLauncher.onSuccess() response:\n", responseStr);
// Parse data field from JSON response object.
JSONValue responseJSONVal = JSONParser.parseStrict(responseStr);
[...]
So the backendMethodURLStr must be maintained to represent the Endpoints API. Are you saying RestyGWT can be used instead of a crude request string + RequestBuilder, with RestyGWT referencing the shared API that only has to be mainained in one place in the project? Ie. RestyGWT will automatically (after its configured by my code) to reference the class EndpointsApi that's generated by the Endpoints @Api and @ApiMethod annotations.
try
{ resultDataStr = endpointsApiService.sayHi(name).execute().getData(); }
catch(IOException e)
{ return e.getMessage(); }
I can recode EndpointsApiService.sayHi(String) elsewhere in my code, change its name, and otherwise change both the API and its implementation - as Java. But in the GWT Endpoints client I have to separately maintain the REST URL strings. There are old (broken) tools like Google's apis-client-generator (generate_library) tool that supposedly generate GWT code from the Java API code (annotated). Are there any that actually work, so "just code in Java" gets maintainable Endpoints in GWT?
...html/src/com/blue_green_group/gdxendpoints/backend/api/gwt/services/endpointsApi/shared/EndpointsApi.java:45: error: cannot find symbol
public enum EndpointsApiAuthScope implements AuthScope {
^
symbol: class AuthScope
location: interface EndpointsApi
...html/src/com/blue_green_group/gdxendpoints/backend/api/gwt/services/endpointsApi/shared/EndpointsApi.java:56: error: method does not override or implement a method from a supertype
@Override
^