SIGN UP MEMBER LOGIN:    
ARTICLE

Querying COM+ through Web Services

Posted by Daniel Stefanescu Articles | COM Interop March 12, 2003
The most COM+ common administrative tasks (creating a COM+ application, installing/deleting a component, setting a component attribute) can be accomplished manually with the Component Services administrative tool from Management Console.
Reader Level:
Download Files:
 

The most COM+ common administrative tasks (creating a COM+ application, installing/deleting a component, setting a component attribute) can be accomplished manually with the Component Services administrative tool from Management Console. But there a few cases (installing the components or changing a components value on a regular basis) when it is necessary to have programmatic access to the COM+ applications, components and interfaces. And in another few cases is needed to perform these operations without having access to MMC (remote computers without TerminalServicess rights or low bandwidth). Thats why I preferred to write a class which provides access to the most essential COM+ tasks and to expose this class through web services.

If you want to perform some action on the COM+ applications or components it is good to know which items (computers, applications, components or interfaces) are available. So in the first part Ill present the class and web service responsible with this duty. The structure of this first web service is:

  • GetComponents - retrieves every component for the specified application
  • GetApplications - retrieves every application
  • GetInterfaces - retrieves every interface for the specified component
  • GetComputers - retrieves the computers found in the Computers folder of the Component Services administration tool

The Component Services Administration (COMAdmin) Library is the point of access to the programmatic administration of the COM+. The (COM+ 1.0 Admin Type) library is distributed by default installation of the Windows 2000 in the %systemroot%\system32\com folder. To be able to use it you need to add a project reference to this library.



Now you can take a look at the COMAdmin library with Object Browser and you can notice three objects (ComAdminCatalog, ComAdminCatalogObject and ComAdminCatalogCollection). The first object is dealing with the reading and writing to the COM+ registration database (RegDB). All collections are structured into a single hierarchy. The ComAdminCatalog represents the root that contains the Application collection. The Application collection has as children the Components and the Roles collections. Access to these collections is a little unusual because you can not access a child collection without accessing the parent collection.

Ive tried to give almost the same tree structure to the XML results as in the COM+ Services administration tool for every web method.

Applications 

Components  

Interfaces  



The GetComponents and the GetInterfaces methods are adding at the top of the list the parents details (Application and Component) for a better vision.

The source code includes a class which is responsible for building the collections and a web service which is using the class for making it available outside so you have to add yourself a reference to the COMAdmin Type Library in your project.

Login to add your contents and source code to this article
share this article :
post comment
 
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Team Foundation Server Hosting
Become a Sponsor