mibuso.com

Microsoft Business Solutions online community
It is currently Fri May 24, 2013 3:37 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: SQL Procedure calling NAV WebService - Credentials
PostPosted: Mon Mar 09, 2009 2:03 am 
Offline

Joined: Mon Feb 23, 2009 7:11 am
Posts: 26
Hi guys,


What fun Web Services are!


I have an assembly in SQL Server 2005 which I created using C# in .NET. A Stored Procedure in SQL is responsible for requesting a .NET function CreateInvoice(string strDocumentNo), which is responsible for calling the exposed Invoice Page Web Service (so my code uses the obj.Create(ref Invoice) call). The CreateInvoice method also gathers the appropriate data from a SQL database. Basically it's transporting an invoice from one SQL Database into NAV.

For Credentials I'm using System.Net.CredentialCache.DefaultCredentials (uses the credentials of the current security context).

If I call this SP from a .NET Application, it works fine, using the current logged-in user's credentials. So as long as that user has adequate permissions in NAV, everything should be fine.

My problem is that in the case that I need this SP to be executed automatically in SQL Server (A trigger perhaps), the security context is then the owner of the MSSQLSERVER service "Local System". I would much prefer to impersonate a different user (without changing the owner of the service), but have hit brick walls thus far.


On its face this does kind-of look like a SQL question, rather than a NAV question, so I'll put it in the SQL thread.

Edit: my apologies, I clicked submit on the wrong tab and it threw my post into the NAV forum :(


Top
 Profile E-mail  
 
 Post subject: Re: SQL Procedure calling NAV WebService - Credentials
PostPosted: Thu Mar 12, 2009 4:37 pm 
Offline
Microsoft employee

Joined: Thu Jan 24, 2008 2:21 am
Posts: 358
Location: MDCC
Country: Denmark (dk)
I think what you need is to allow delegation for you SQL server to be allowed to impersonate users towards the Service Tier.

_________________
Freddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk

The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: