问题
I'm trying to create my first GAE Endpoint app, and instead of generating an endpoint from a class, I'd like to create my own personalised Endpoint... is this possible?
I've written this class:
@Api(name="my_endpoint", path="my_endpoint")
public class MyFirstEndpoint {
@ApiMethod (name="my_method", path="my_method", httpMehod=HttpMethod.GET)
public Response myMethod(@Named("param1") String param1) {
...
}
}
But when I try to generate the Endpoint Client Library in Eclipse, it says that there was an error... and the worst thing is that it doesn't say what error it is!
回答1:
Yes it's possible to create custom Endpoints.
I had the same error. I think you can't use "_" in the name of the Api nor the ApiMethod...
Try using "myEndpoint" and "myMethod" as the names and keep the "_" in the paths.
回答2:
A bit unrelated to this particular case, but it's the first thing that popped up on Google when searching for the error: you can't have overloaded methods in your Endpoints classes. Found this by looking in the Error console as described above in a comment.
来源:https://stackoverflow.com/questions/15684837/eclipse-doesnt-generate-google-cloud-endpoint-client-library