ibm mobilefirst - Worklight Java adapter invoke another adapter get I/O issue -


i have issue when try call adapter (http/mysql) java adapter.

when using postmen test (added authorization on header) it's io issue:

[i o: invalid token on line 1, column 14].

first, guess should oauth issue, add @oauthsecurity(enabled=false) @ class not work.

would please me find out problem is.

code snippet:

dataaccessservice service = worklightbundles.getinstance()             .getdataaccessservice(); procedureqname name = new procedureqname("mysqladapter",             "getmysqladapters"); string para = ""; // string para = "['a','b','c']"; invocationresult mysql= service.invokeprocedure(name, para); jsonobject jsmysql = mysql.tojson(); //string rst = jsmysql.get("key").tostring(); 

ps following code snippet working when test on postman:

httpurirequest request = api.getadaptersapi()             .createjavascriptadapterrequest("mysqladapter", "getmysqladapters");  try {     httpresponse response = api.getadaptersapi().executeadapterrequest(request);     jsonobject jsonobj =api.getadaptersapi().getresponseasjson(response);     return jsonobj.tostring(); } catch (mfpserveroauthexception e) {     e.printstacktrace(); } catch (ioexception e) {     e.printstacktrace(); } return "error"; 

i confused...

  1. you use tag "worklight", product worklight 4.x-6.2 not have java adapters support. there javascript adapters support , ability javascript adapter call java code on server. there ability call javascript adapter java code - not confused java adapter.

  2. java adapters exists starting mobilefirst platform foundation 7.0 (formerly called "worklight", tag "mobilefirst"). mention because you've mentioned oauth support, introduced alongside java adapters in mobilefirst platform foundation 7.0. has got nothing of code snippets. java adapter looks nothing that.

so,

also note @ time not possible call java adapter javascript adapter (the opposite way of request, if understood correctly).


Comments