Hi Everyone,
I'm consuming NAV web services with web application in .NET.
The code creates connections with a default user (shared between multiple users) and connection for each user. The authentication I'm using is Windows Credentials.
I've noted that after I consume a web service the session, also if the connection will be closed and disposed, remains in NAV. Sometimes a pending connection can create delay or lock some table.
Did someone have a similar issue? Is there a parameter to set to force the close of the session after the web service has been consumed?
I've tried everything in .NET but not solution so I think is NAV that maintain the Session maybe to reuse it or for caching purpose.
Thanks for your thoughts
Eclipses
*This post is locked for comments
Hi Tharanga,
Let me understand better your comment:
I call a method via Web Service and at the end of the method itself i should insert a code to close the session?
This is the first part where you say that the code ti kill the session will be on NAV.
Then you suggest to do it on SQL but no Idea how to know when i can kill the session, that should be after the the Web Service has been consumed.
I think that if a call a method and inside there is the code that kill the session the integration will fail consuming the Web Service, obviously is to test. The second part is not clear for me cause the Session that I can see in the Active Session table in NAV are different of the sessions in SQL.
Best Regards
Eclipses
Just a suggestion,
Can't you write a small code to kill the session in NAV once you finish the integration? Will that help? You can write this on the SQL side. (Just an idea)
Hi Nareshwar,
Unfortunately NAV leave in the Active Sessions connection idle and sometimes also connection closed (e.g. a client crashed). To refresh the list you should restart the Nav Service.
The issue is identify the sessions to kill cause are idle.
I suppose it works so as per design, so I cannot open any BUG to Microsoft but maybe I have to change the design of the solution.
I hope someone else that faced similar issue will share his thoughts.
Thanks
Eclipses
Hi Sergio,
As per theory, since the webservice calls are for a short period of time, it automatically closes the connection after the processing. If not there will be a conflict with concurrent users in the license what you have purchased.
By the way, this is a good read: dynamicsuser.net/.../nav-2013-2015-session-counting
Also this question: forum.mibuso.com/.../kill-session-after-using-web-service
But, can you provide me with code snippets and methods that you have tried?
Also, we use STOPSESSION() function to force-stop the sessions from C/AL, but I am not sure how it is helpful in .NET.
Hope it helps.
Sohail Ahmed
2
mmv
2
Amol Salvi
2