Pass Navision Session table data through web service?

KarlRhodes
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.
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?
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?
0
Answers
-
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.0
-
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.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions