I am developing an app with JS Service. I have used fileIOService and it's working fine. But when I try to add SCAP library, and created a service, it's showing an error that the service does not exists. Here is the piece of code I am working on:
var Service = require('webos-service');
var service = new Service('com.lg.app.signage.fileIOService');
var servicescap = new Service('com.lg.app.signage.scapservice');
var Configuration = require('./scap_on_JSservice/configuration_soj.js');
var configuration = new Configuration(servicescap);
service.register("Configuration/getCurrentTime", function (message) {
configuration.getCurrentTime (
function (cbObject) {
message.respond ({returnValue: true, returnData: cbObject});
},
function (cbObject) {
message.respond ({returnValue: false, errorCode: cbObject.errorCode, errorText: cbObject.errorText});
},
message.payload
);
});
It's showing following error when I call getCurrentTime() function:
{
"returnValue": false,
"errorCode": -1,
"errorText": "Service does not exist: com.lg.app.signage.scapservice."
}