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("Transie ntSubscriptions");
subscription = (ICatalogObject)transientCollection.Add();
subscription.set_Value("Name",subName);
subscription.set_Value("SubscriberInterface",subsc riber);
string eventClassString = "{"+eventClass.GUID.ToString()+"}";
subscription.set_Value("EventCLSID",eventClassStri ng);
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();
}