I learned Google endpoints from a tutorial at https://developers.google.com/appengine/docs/java/endpoints/ . I got the endpoint successfully deployed to Google App Engine, and I managed to create a simple iPhone app that calls the endpoint. However, my iPhone application receives the following error when trying to call an endpoint:
Error message
error NSError * domain: @ "com.google.GTLJSONRPCErrorDomain" - code: -32099 0x00000001094518a0
_userInfo __NSDictionaryI * 3 key / value pairs 0x00000001094452b0
[0] (null) @ "error": @ "java.lang.IndexOutOfBoundsException: Index: 0, Size: 0"
[1] (null) @ "NSLocalizedFailureReason": @ "(java.lang.IndexOutOfBoundsException: index: 0 , size: 0) "
[2] (null) @" GTLStructuredError ": (no resume)
iPhone Caller API (in Objective-C works in Xcode Debugger)
- (IBAction)myButton:(id)sender {
NSInteger myId;
if (self.mySwitch.isOn) {
myId = 0;
}
else {
myId = 1;
}
GTLQueryHelloworld *query = [GTLQueryHelloworld queryForGreetingsGetGreetingWithIdentifier:myId];
[self.helloWorldService executeQuery:query completionHandler:^(GTLServiceTicket *ticket, id object, NSError *error) {
if (!error) {
[self.myLabel setText:object];
}
else {
[self.myLabel setText:[error description]];
}
}];
}
I found the same error message reported in Youtube video download failed after 100% progress for some users with the code Backend Error: -32099 , but this was due to YouTube calls and it was eventually closed as an error that was fixed. Therefore, I do not think it is connected.
I believe the error is on the client side because I put some entries on the server (Java) and it does not seem to be called:
public class Greetings {
private static final Logger log = Logger.getLogger(Greetings.class.getName());
public static ArrayList<HelloGreeting> greetings = new ArrayList<HelloGreeting>();
static {
log.setLevel(Level.INFO);
greetings.add(new HelloGreeting("hello world!"));
greetings.add(new HelloGreeting("goodbye world!"));
}
public HelloGreeting getGreeting(@Named("id") Integer id) {
log.info("HelloGreeting called with getGreeting");
log.info("getGreeting id " + id);
return greetings.get(id);
}
"HelloGreeting, getGreeting" Google, , , - , , Endpoint :
21: 56: 45.639 : https://1-war-dot-firstendpointproject.appspot.com/_ah/api/helloworld@v1
, API helloworld.greetings.getGreeting API- :
https://1-war-dot-firstendpointproject.appspot.com/_ah/api/explorer
API , :
24.130.150.54 - - [19/Jun/2014: 21:17: 45 -0700] "POST/_ah/spi/com.google.appengine.samples.helloendpoints.Greetings.getGreeting HTTP/1.1" 200 93 " https://1-war-dot-firstendpointproject.appspot.com/ah/api/static/proxy.html?jsh=m%3B%2F% 2Fscs% 2Fapps % 2F_% 2Fjs% 2% 3Doz.gapi.en.htta44JhPmg.O% 2Fm% 3D__features __% 2Fam% 3DAQ% 2Frt% 3Dj% 2Fd% 3D1% 2Fz% 3Dzcms% 2Frs% 3DAItRSTPk1CJ1YqUCyb--zhkQTjKPZwvbQ " "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, Gecko) /7.0.3 Safari/537.75.14" "1-war-dot-firstendpointproject.appspot. com" ms = 17 cpu_ms = 87 cpm_usd = 0.000010 instance = 00c61b117ce13f56d6eb483511c2c1bcd24241 app_engine_release = 1.9.6
"HelloGreeting, getGreeting", , , . , , . API 1 , , .
:
1] , , ?
2] , ?
3] ?
StackOverflowers!