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