I made simple application. Added android and desktopbrowser environments. Android app works fine.
While preview desktopbrowser environment getting Error Access Denied Reload dialog box infinite times.
Made below two changes in "worklight.properties" file.
mfp.session.independent=false
mfp.attrStore.type=HttpSession
Tried with restarting server and eclipse as well.
Code to reproduce below:
function wlCommonInit(){
WL.Client.connect({
onSuccess: onConnectSuccess,
onFailure: onConnectFailure
});
}
function onConnectSuccess(){
alert("Connected to Server");
WL.Client.checkForDirectUpdate();
}
function onConnectFailure(){
alert("Connection Failure");
}
$("p").click(function(){
alert("Paragraph Clicked");
getData();
});
function loadFeedsSuccess(result){
invocationResult = result.invocationResult;
alert(JSON.stringify(invocationResult.firstName));
alert(JSON.stringify(invocationResult.lastName));
}
function loadFeedsFailure(error){
console.log("Feed retrieve failure");
alert(JSON.stringify(error));
alert("Feed retrieve failure");
}
function getData() {
var invocationData = {
adapter : 'Test',
procedure : 'getAdapter',
parameters : []
};
WL.Client.invokeProcedure(invocationData,{
onSuccess : loadFeedsSuccess,
onFailure : loadFeedsFailure,
});
}