Topic
  • 2 replies
  • Latest Post - ‏2012-05-15T13:37:54Z by SystemAdmin
SystemAdmin
SystemAdmin
570 Posts

Pinned topic Problem with Invoking Worklight Adapter

‏2012-05-14T12:01:29Z |
I am stuck trying to invoke a deployed SQL Adapter

The command WL.Client.invokeProcedure does not enter viewPortfolioSuccess. I am not able to debug as
WL.Logger.debug("Porfolio retrieve success"); is not written to the server log.

The code I used is as follows

var invocationData = {
adapter : 'PortfolioAdapter',
procedure : 'viewPortfolio',
parameters : userid
};

WL.Client.invokeProcedure(invocationData,{
onSuccess : viewPortfolioSuccess,
onFailure : viewPortfolioFailure,
});

function viewPortfolioSuccess(result){
alert("inside viewPortfolio success");
WL.Logger.debug("Porfolio retrieve success");

if (result.invocationResult.Items.length>0)
displayPortfolio(result.invocationResult.Items);
else
viewPortfolioFailure();
}

function viewPortfolioFailure(result){
alert("inside viewPortfolio failure");
WL.Logger.error("Portfolio retrieve failure");
busyIndicator.hide();
WL.SimpleDialog.show("PortfolioAdapter", "Cannot retrieve data. Check Database Connectivity.",
[{
text : 'Reload App',
handler : WL.Client.reloadApp
}]);
}

Any help appreciated as I am not able to proceed
  • SystemAdmin
    SystemAdmin
    570 Posts

    Re: Problem with Invoking Worklight Adapter

    ‏2012-05-15T09:01:50Z  
    Figured out the error. Problem with javascript variables used.

    Still unable to figure out

    WL.Logger.error
    and WL.Logger.debug

    I am unable to get the statements for DEBUG and ERROR in server.log. Any configuration parameters I need to set to enable WL logging.
  • SystemAdmin
    SystemAdmin
    570 Posts

    Re: Problem with Invoking Worklight Adapter

    ‏2012-05-15T13:37:54Z  
    Hello Krish.

    WL.Logger.error and WL.Logger.debug are client side logging API.
    You can see them in the console of your browser debugger (like FireBug in FireFox), or in LogCat for Android in Eclipse.
    They are not written to the server log.
    Server side code (like the adapter JavaScript code) can be debugged to the server.log.