Search code examples
ibm-mobilefirstworklight-adaptersmobilefirst-adapters

How to invoke Java adapter procedure from JS adapter procedure in MobileFirst Platform 7.0?


Our team is migrating to MobileFirst Platform 7.0 because of Java adapters introduced in this version. And after having a quick look I haven't found how to invoke procedures in Java adapter from procedures in JavaScript adapters. Looks like Java adapter doesn't define procedures and has only REST endpoints. How to access them from JS adapter?


Solution

  • In general the new RESTful JAX-RS (Java-based) adapters in version 7.0 operate independently of the old JavaScript-style adapters. I'm not aware of an in-process API to call them, so you would have to call them like any other RESTful service using WL.Server.invokeHttp (i.e. like how you might typically do this using the HTTP adapter).

    However, don't confuse the new RESTful JAX-RS (Java-based) adapters with using custom Java code in older-style JavaScript adapters, which you can also do (and were able to do prior to 7.0). See this tutorial for more information on the latter.