ModuleService Class
IIS 7.0
Provides the base class for implementing new management modules (IIS Manager extensions).
System..::..Object
Microsoft.Web.Management.Server..::..ModuleService
Microsoft.Web.Management.Server..::..ConfigurationAuthenticationModuleService
Microsoft.Web.Management.Server..::..ModuleService
Microsoft.Web.Management.Server..::..ConfigurationAuthenticationModuleService
Assembly: Microsoft.Web.Management (in Microsoft.Web.Management.dll)
The ModuleService type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Context | Gets the management context of the module service. |
![]() | ManagementUnit | Gets the ManagementUnit that is currently being managed by the module service. |
![]() | ModuleName | Gets the name of the assembly that contains the module service. |
| Name | Description | |
|---|---|---|
![]() | CreateChildService | Creates a child ModuleService object. |
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | (Inherited from Object.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetType | (Inherited from Object.) |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | RaiseException(Exception) | Throws a WebManagementServiceException based on the specified exception. |
![]() | RaiseException(String) | Throws a WebManagementServiceException based on the specified resource name. |
![]() | RaiseException(String, String) | Throws a WebManagementServiceException based on the specified resource name and error message. |
![]() | ToString | (Inherited from Object.) |
The ModuleService members are exposed through the ModuleServiceProxy class. A derived ModuleService class should contain all the program logic for the management module.
A module service is a Web service that executes code to implement the features that access and modify management information.
The following example shows how to create a simple class that derives from the ModuleService class and retrieves the application's settings.
using System; using System.Diagnostics; // for Trace.WriteLine using System.Collections; using System.Security.Principal; // for WindowsBuiltInRole using Microsoft.Web.Administration; using Microsoft.Web.Management.Server; namespace rxDemo { public class DemoModuleService : ModuleService { ArrayList _infoLst = new ArrayList(); [ModuleServiceMethod] public ArrayList GetSettings() { // expose GetSettings ConfigurationSection appSettingsSection = ManagementUnit.Configuration.GetSection("appSettings"); ConfigurationElementCollection settings = appSettingsSection.GetCollection(); ArrayList settingsList = new ArrayList(); foreach (ConfigurationElement setting in settings) { PropertyBag settingBag = new PropertyBag(); settingBag[0] = setting.GetAttribute("key").Value; settingBag[1] = setting.GetAttribute("value").Value; settingBag[2] = setting.IsLocallyStored ? "Local" : "Inherited"; settingsList.Add(settingBag); } if (settingsList.Count < 1) { // If there are no setting AddEmptyData(); // Add info so we know our code return _infoLst; // is working. } TraceInternal(); return settingsList; }
