We have written a small monitoring web site for our customer that shows the current status of their Navision system.
This was done by creating a codeunit that has a number of functions that gather data and counts for job queues etc and published the data through a page, which has been configured to be used as a web service.
The website then calls this web service and displays the data dynamically.
My question is this.
One of the counts that the codeunit creates is the number of Sessions (from the Virtual table "Session") where the Application Name is either "Microsoft Dynamics NAV Classic client" or "Application Server for Microsoft Dynamics NAV Classic". When the codeunit is run from Navision (and displayed in a list form, or displayed in an RTC page) then the correct count is displayed.
However, when calling the published page as a web service using ASP.Net, the count is always 0.
It seems the web service is somehow, unable or unwilling to give us this count.
The code in the codeunit that gets this count is as follows.
tblSession.RESET;
tblSession.SETFILTER("Application Name",
'Microsoft Dynamics NAV Classic client|Application Server for Microsoft Dynamics NAV Classic');
intValue := tblSession.COUNT;
I have even tried writing a brand new codeunit just to get the count of sessions by itterating through them, checking the Application Name, and if its one of our chosen types, incrementing a count, and returning this as a return parameter in the function. It still returns 0.
Has anyone else experienced this, or does anyone know why the data does not carry through the web service?
Answers
What setup parameter controls this?
Credentials which are used for authentication are the one which will be used on server. Those credentials should have rights to access session table, at least in 2013+. It should be set with SUPER role.
Since KarlRhodes is mentioning Session table and Classic client, I suppose he is referring to NAV2009 version.