I am trying to invoke an integration service in a JavaScript module in Kony Studio. Previously I created the service "TestService" with the operation "getPostsByUserID" in the MobileFabric console. The service calls an API that returns an JSON object. I want to use the returned data in my app.
If I test the app on the simulator I get the error Invalid serviceName from the Kony SDK.
I've met the following prerequisites:
- The app is published to the Kony Server.
- I initialized the Kony SDK.
- The names of the service and the operation are correct. I checked this several times.
Does anybody have an advice what I missed?
function getPosts () {
serviceName = "TestService";
integrationObj = client.getIntegrationService(serviceName);
integrationObj.invokeOperation("getPostsByUserID", {}, {userID: 1}, successCallback, failureCallback);
function successCallback (res) {
alert('success: ' + res);
}
function errorCallback (res) {
alert('error' + res);
}
}
client
is the intialized Kony SDK object.
I got it. Everytime I make a change on the Integration Services in the MobileFabric console I have to: