Options

Pass Navision Session table data through web service?

KarlRhodesKarlRhodes Member Posts: 37
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

  • Options
    PhennoPhenno Member Posts: 630
    Does your user has appropriate rights to see session table data? I this only SUPER role can do that (no sure, but I would check that). Depending on setup it is either user who is calling wrbsetvice or service account that is running soap service.
  • Options
    vaprogvaprog Member Posts: 1,128
    Phenno wrote: »
    Depending on setup it is either user who is calling wrbsetvice or service account that is running soap service.

    What setup parameter controls this?
  • Options
    PhennoPhenno Member Posts: 630
    Huhh, my bad, I was referring to ServicesCultureDefaultUserPersonalization, which only controls if language (culture) will be used from user's card or service's settings.

    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.
Sign In or Register to comment.