Hi all.
I'm looking for help getting SharePoint 2007's SPPersistedObject to store information at the Farm level.
When I create a persistent object as a child of the SPFarm instance and call my object's Update() method, an "Access Denied" exception is thrown. Looking at the SharePoint log, I see a complaint that "the current user is not a Farm Administrator"
To find out who the current user really is, I've set a breakpoint in my WebMethod, and when it's invoked I can see that the Environment.UserName is my user "dummy" and the Environment.UserDomainName is the local machine domain.
I've added this LOCALMACHINENAME\dummy to the Farm Administrator group (using the Central Administration console), but I still get this exception.
Does anyone have an idea of what I might try next to diagnose this?
I include the debugger stacktrace and SharePoint log excerpt below.
Thanks much.
Debugger Stacktrace:
at Microsoft.SharePoint.Administration.SPPersistedObject.Update()
at Microsoft.SharePoint.Administration.SPPersistedObject.Update(Boolean ensure)
at Equilibrium.FOO4SP.WebService.FOO4SPWebService.UpdatePersistedObject(SPPersistedObject properties)
SharePoint log file:
02/18/2010 09:20:18.36 w3wp.exe (0x15CC) 0x1518 Windows SharePoint Services Topology 8xqz Medium Updating SPPersistedObject FOO4SPPersistedProperties Name=FOO4SP Parent=SPWebApplication Name=SharePoint - 2633. Version: -1 Ensure: 1, HashCode: 49982922, Id: 6e54627b-be20-4f85-9d9d-28fde2d592d8, Stack: at Microsoft.SharePoint.Administration.SPPersistedObject.Update() at Microsoft.SharePoint.Administration.SPPersistedObject.Update(Boolean ensure) at Equilibrium.FOO4SP.WebService.FOO4SPWebService.UpdatePersistedObject(SPPersistedObject properties) at Equilibrium.FOO4SP.WebService.FOO4SPWebService.GetWebApplicationPersistedProperties(Guid webApplicationId) at Equilibrium.FOO4SP.WebService.FOO4SPWebService.GetWebApplicationProperties(Guid webApplicationId) at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes...
02/18/2010 09:20:18.36* w3wp.exe (0x15CC) 0x1518 Windows SharePoint Services Topology 8xqz Medium ... methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values) at System.Web.Services.Protocols.WebServiceHandler.Invoke() at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest() at System.Web.Services.Protocol...
02/18/2010 09:20:18.36* w3wp.exe (0x15CC) 0x1518 Windows SharePoint Services Topology 8xqz Medium ...s.SyncSessionlessHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) at System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(Exception error) at System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) at System.Web.HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr) at System.Web.Hosting.ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
02/18/2010 09:20:18.36 w3wp.exe (0x15CC) 0x1518 Windows SharePoint Services Topology 8dyu High The SPPersistedObject, FOO4SPPersistedProperties Name=FOO4SP Parent=SPWebApplication Name=SharePoint - 2633, could not be updated because the current user is not a Farm Administrator.