this is my service.js,using Wl.Client.invoke,dont know which files i am missing ,do i need wlinit.js or initoptions.js or do i need to install any plugin
.factory('loginservice', function(){
var user;
return{
checkvalue:function(settings){
user=settings;
console.log(user);
var invocationData = {
adapter : 'sqltest2',
procedure : 'checkvalue',
parameters : [user.username,user.password]
};
WL.Client.invokeProcedure(invocationData,{
onSuccess : loginSuccess,
onFailure : loginFailure
});
function loginSuccess(result){
console.log("Retrieve success" + JSON.stringify(result));
//displayFeeds(result.invocationResult.resultSet);
}
function loginFailure(result){
console.log("Retrieve failure");
}
}
}
})
IBM MobileFirst platform 8.0 sqladapter ReferenceError: WL is not defined
I assume you are using IBM MobileFirst platform 8.0, You have to install mfpdev-cli & cordova-plugin-mfp then use WLResourceRequest. see the sample:
var resourceRequest = new WLResourceRequest(
"/adapters/JavaAdapter/users",
WLResourceRequest.GET
);
var formParams = {"param1": "value1", "param2": "value2"};
resourceRequest.sendFormParameters(formParams);
resourceRequest.send().then(
onSuccess,
onFailure
)
WL.Client.invokeProcedure is no longer in use in IBM MobileFirst 8.0.
I suggest that you will take a tour of the MobileFirst Foundation development in Cordova applications . See here:
Integrating MobileFirst Foundation 8.0 in Ionic-based apps: https://mobilefirstplatform.ibmcloud.com/blog/2016/07/19/integrating-mobilefirst-foundation-8-in-ionic-based-apps/
Adding the MobileFirst Foundation SDK to Cordova Applications: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/application-development/sdk/cordova/
Resource request from JavaScript (Cordova, Web) applications: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/application-development/resource-request/javascript/