MSDN Magazine Launch Issue - February 15, 2008 - (Page 50) Figure 8 Response Modification Page in IIS Manager • The Microsoft.Web.Management.Cli ent.Mod uleServiceProxy class, which provides the client components with a local proxy class for invoking the service methods exposed by the ModuleService. The Mvolo.ResponseModificationUI.Server.dll assembly contains the ResponseModificationModule class shown in Figure 7 (not to be confused with the actual IHttpModule class that provides the module services in the IIS request processing pipeline), which provides the main entry point for registering all of the needed UI components in IIS Manager. This class registers the ResponseModificationModulePage class, which describes the actual management page. Each Module implementation is created once per the lifetime of a management connection made with IIS Manager, and it is responsible for registering all of the necessary management pages and UI elements for the connection. ResponseModificationModule registers the ResponseModificationModulePage class, which defines the contents of the management page. To be honest, I am not a big fan of GUI programming, and I much prefer to write low-level server code that does not require interface development. Lucky for me, the Microsoft.Web.Management framework provides a number of base classes and supporting Figure 9 IIS Manager Extension Configuration classes for implementing common-looking management pages, including the Microsoft.Web.Management.Client.Win32.ModuleListPage class that I used for ResponseModificationModulePage. This class provides a built-in List view for viewing and managing lists of items, including sorting the list and interacting with list items. With a minimum amount of customization, I was able to create a management page containing a list of response modification rules (see the center panel of Figure 8). Next, I created the list of actions, displayed in the right panel, for allowing the response modification rules to be added, edited, and removed. I took advantage of the Microsoft.Web.Management.Client.TaskList class to create this task list (shown in the right panel in Figure 8). With just a little more work, the Response Modification feature shown in Figure 8 was born. You can review the details of the UI in the source code for the Response Modification framework. The initial page creation, and the add, edit, and delete operations triggered from the action panel are performed by invoking methods on the ResponseModificationModuleServiceProxy class, which provides a local proxy to the module methods exposed by the module service: public sealed class ResponseModificationModuleServiceProxy : ModuleServiceProxy { public ArrayList GetFilterRules() { return (ArrayList)Invoke(“GetFilterRules”); } public void AddFilterRule(PropertyBag bag) { Invoke(“AddFilterRule”, bag); } } IIS Manager automatically relays calls made to the module service proxy class to the associated module service over the communication channel, which may be a local shared memory channel or an https channel to a remote server. To deploy the IIS Manager extension, note that you have to register the module provider type in the IIS Manager configuration file on the server (%windir%\system32\inetsrv\config\administration.config). The configuration shown in Figure 9 registers the module provider and enables it to be used for all sites by default. Note that both the client and server assemblies that comprise the extension, Mvolo.ResponseModificationUI.Server.dll and Mvolo.ResponseModificationUI.Client.dll, must be registered in the Global Assembly Cache (GAC) and therefore must be strongnamed and signed. This is a requirement for being able to install IIS Manager extensions. When IIS Manager is used to manage the server remotely, the Deploying the Extension 50 msdnmagazine IIS 7.0
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.