I am new to Windows Azure mobile services , and now i need to post sign up data to Mysql table in Windows Azure Mobile Services.
I have made a pojo class (USER) , and saved user entered data to them , and now calling custom api line using this line.
ListenableFuture<User> result = mClient.invokeApi( "signup", User.class );
Log.d("try","THIS LINE IS OKAY");
Futures.addCallback(result, new FutureCallback<User>() {
@Override
public void onFailure(Throwable exc) {
createAndShowDialog((Exception) exc, "Error");
}
@Override
public void onSuccess(User result) {
createAndShowDialog( " item(s)inserted", "Success");
}
});
}
I have created a Custom API , in Mobile Services ,
exports.post= function(request, response) {
var queryString = "INSERT INTO User (user_name, user_email) VALUES (?,?)" ;
request.service.mssql.query(queryString, [request.query.username, request.query.user_email], {
success: function(results) {
request.respond(statusCodes.OK, results);
}
});
};
While running app , i am getting a Internal Server Error 500.
Any one please help me to resolve issue,
invokeApi
method, and your custom API in the script is trying to read them (username, user_email). That will certainly lead to failures. – carlosfigueira