Groups | Blog | Home
all groups > dotnet component services > may 2004 >

dotnet component services : "Access Denied" to ICatalogCollection from asp.net web service


Ollie
5/22/2004 9:01:09 AM
I am trying to access the transients subscriptions for a remote COM+ server
from an asp.net web service, the problem is access rights to save to the
local transient subscriptions, the code fails when I attempt to call
'SaveChanges' a System.UnauthorizedAccessException is generated.

So what access rights to I have give to the asp.net process for it to work
or do I have to use impersonation to setup the subscription?

The code is written in C# and OS is Windows 2003 + IIS 6., the code is shown
below....

Cheers in advance


Ollie

static public void Add(string subName,Type eventClass,Type
sinkInterface,string method,object subscriber)
{
Type sinkType = subscriber.GetType();

//Verify the interface has that method
if(method != "")
{
MethodInfo info = sinkInterface.GetMethod(method);
if(info == null)
return;
}

//Adding a new transient subscription to the catalog
ICOMAdminCatalog catalog;
ICatalogCollection transientCollection;
ICatalogObject subscription = null;

catalog = (ICOMAdminCatalog)new COMAdminCatalog();
transientCollection =
(ICatalogCollection)catalog.GetCollection("TransientSubscriptions");

subscription = (ICatalogObject)transientCollection.Add();
subscription.set_Value("Name",subName);
subscription.set_Value("SubscriberInterface",subscriber);

string eventClassString = "{"+eventClass.GUID.ToString()+"}";
subscription.set_Value("EventCLSID",eventClassString);

string sinkString = "{" +sinkInterface.GUID.ToString()+ "}";
subscription.set_Value("InterfaceID",sinkString);

subscription.set_Value("MethodName",method);
subscription.set_Value("FilterCriteria","");
subscription.set_Value("PublisherID","");

// FAILS HERE
transientCollection.SaveChanges();
}

Ollie
5/22/2004 12:08:51 PM
found this

http://www.dotnet247.com/247reference/msgs/25/128688.aspx

[quoted text, click to view]

AddThis Social Bookmark Button