how to return HttpResponseObject execute(HttpRequestObject request) after return App42CallBack function?

0 votes

this is mycunstom code ....

public HttpResponseObject execute(HttpRequestObject request) {

JSONObject body = request.getBody();

JSONObject jsonResponse = null;

try {

jsonResponse = SummonHero(GameMsg,strUserName);

} catch (JSONException e) {

}

return new HttpResponseObject(HTTP_STATUS_SUCCESS, jsonResponse);

 

---> this is my callback function()

public JSONObject SummonHero( final int GameMsg, final String strUserName ) 

{

final JSONObject responseJSON = new JSONObject();//create response summonhero json by zet 160205

Query q1 = QueryBuilder.build("name", strUserName, Operator.EQUALS);  

storageService.findDocumentsByQuery(dbName,"BattleInfo",q1, new App42CallBack()  { 

public void onSuccess(Object response){

 ---> this is my callback ok 

}

i want to control data inside App42CallBack after  return new HttpResponseObject(HTTP_STATUS_SUCCESS, jsonResponse); function..... 

but   return new HttpResponseObject(HTTP_STATUS_SUCCESS, jsonResponse) call !!!!  before  App42CallBack()  onSuccess() function call !!!!!

how can i controll callback function before  return new HttpResponseObject(HTTP_STATUS_SUCCESS, jsonResponse);  call?

 

 

 

 

asked Feb 13, 2016 in Java by zetcrusader (13 points)
recategorized Mar 8, 2016 by shepAdmin

1 Answer

0 votes
Hi,

Instead of making Asynchronous calls from Custom code, you can call synchronous API to get the control of method response. Please use synchronous API inside custom code and let me know if you need any help while integrating it.

I will be happy to address your concern.

regards,

Himanshu Sharma
answered Feb 13, 2016 by hs00105 (2,005 points)
Can you please provide the references for Synchronous api inside custom code ?
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...