New Programmatic Features

   

IIS 6.0 provides several new programmatic features and continues to build on the ISAPI programming model. These new features include the following:

  • ASP.NET and IIS integration

  • Internal redirection ( ExecuteURL and global interceptors )

  • Buffer and handle send ( VectorSend )

  • Caching dynamic content

  • ISAPI support for custom errors

  • Worker process recycling

  • Improved ISAPI Unicode support

  • COM+ services in ASP

ASP.NET

Windows Server 2003 offers an improved developer experience with ASP.NET and IIS integration. Building upon IIS 6.0, platform enhancements offer developers very high levels of functionality ”for example, rapid application development and a wide variety of languages to choose from. With Windows Server 2003, the experience from using ASP.NET and the .NET Framework is improved as a result of enhanced process model integration in IIS 6.0. IIS 6.0 also offers support for the latest Web standards, including XML, SOAP, and IPv6.

ExecuteURL

The HSE_REQ_EXEC_URL server support function now allows an ISAPI extension to easily redirect a request to another URL. It answers growing demand by ISAPI extension developers to chain requests .

ExecuteURL provides functionality to replace almost all read raw data filters. The most common customer scenario for developing read raw data filters is that developers want to examine or modify the request entity body before the target URL processes it. Currently the only way to see the entity body of a request (if you are not the target URL) is through read raw data notifications. Unfortunately, writing an ISAPI filter to accomplish this goal can be exceedingly difficult, or even impossible in some configurations.

ISAPI extensions, on the other hand, provide functionality for easy retrieval and manipulation of the entity body. ExecuteURL allows an ISAPI extension to process the request entity body and pass it to a child request, meeting the needs of nearly all read raw data filter developers.

Global Interceptors

ExecuteURL allows IIS 6.0 to implement ISAPI request interceptors that can intercept, change, redirect, or deny every incoming HTTP request for a specific URL space:

  • IIS 5.0 already supports one ISAPI extension that intercepts all requests with a single wildcard (*) script map that's configured by editing the application mappings for an application.

  • In IIS 6.0, the single wildcard (*) script map concept is extended to allow a multiple execution of global interceptors.

Accepting all requests for a specific URL was a functionality that was possible only in ISAPI filters. But ISAPI filters have problems. They're global for a Web site. They can't do long running operations (for example, database queries) without starving the IIS thread pool. They can't access the entity body of the request. Because global interceptors are ISAPI extensions, they don't have the limitations of ISAPI filters, and they provide the functionality, together with ExecuteURL , to replace almost all read raw data filters.

VectorSend

Today ISAPI developers have only two possibilities if they have multiple buffers that make up a response. They can either call WriteClient multiple times or assemble the response in one big buffer.

  • The first approach is a performance bottleneck because there is one kernel-mode transition per buffer.

  • The second approach costs performance too, and it requires additional memory. VectorSend is the IIS 6.0 solution to this problem.

Implemented as a server support function for ISAPIs, VectorSend allows developers to put together a list of buffers and file handles to send, in order, and then hand off to IIS 6.0 to compile the final response. HTTP.sys compiles all the buffers and file handles into one response buffer within the kernel and then sends it. This frees the ISAPI from having to construct a buffer or make calls to WriteClient .

Caching of Dynamic Content

Another new feature is the implementation of a kernel-mode cache for dynamic content. The benefit of this feature is that many customers have programmatically created content that doesn't change.

In previous versions of IIS, requests had to transition from kernel mode to user mode for every dynamic request, and the responses had to be regenerated. Eliminating this transition and pulling the cached content from the kernel-mode cache results in a marked performance improvement.

ReportUnhealthy

A new ISAPI extension server support function named HSE_REQ_REPORT_UNHEALTHY allows an ISAPI extension to call into the IIS 6.0 worker process to request that the worker process be recycled. Developers can use this new server support function to request a recycle if their application ISAPI becomes unstable or enters an unknown state for any reason.

Note

To enable recycling after an ISAPI calls HSE_REQ_REPORT_UNHEALTHY , health monitoring should be turned on.


When calling HSE_REQ_REPORT_UNHEALTHY , the developer can also pass a string representing the reason why the ISAPI is calling HSE_REQ_REPORT_UNHEALTHY . This string is then added to the event that the worker process publishes to the Application event log.

Custom Errors

ISAPI developers no longer need to generate their own error messages. Instead, they can plug in to the custom error support built into IIS through a new server support function named HSE_REQ_SEND_CUSTOM_ERROR .

Unicode ISAPI

Unicode becomes more and more important in a global economy. Because of the non-Unicode structure of the HTTP protocol, IIS 5.0 limits the developer to the system code page. With UTF-8 encoded URLs, Unicode becomes possible. IIS 6.0 allows customers to get to server variables in Unicode and adds two new server support functions to allow developers to obtain the Unicode representation of a URL. International customers with multilanguage sites benefit from this feature and from an improved development experience.

COM+ Services in ASP

In IIS 4.0 and 5.0, ASP applications are able to use COM+ services by configuring the application's Web Application Manager (WAM) object in the COM+ configuration store to use a set of services. This is because that COM+ services were developed to be used in conjunction with COM components . In IIS 6.0, the IIS and COM+ teams have separated the COM+ services from the components and allowed ASP applications to use a set of COM+ services.

In addition to the services available in COM+ in Windows 2000, a new service called Fusion has been added and is supported in ASP. Fusion allows an ASP application to use a specified version of a system run-time DLL or classic COM component. Fusion allows an application developer to specify exact versions of system run-time libraries and classic COM components that work with the developer's application. When the application is loaded and running, it will always receive these versions of the run-time libraries and COM components. Previously, applications had to use whatever version of the system run-time DLL was installed on the system. This could present problems if a newer version were installed and had changed functionality in some way.

Additional COM+ features include the following:

  • COM+ partitions allow an administrator to define a different configuration of a single COM+ application for different users. This configuration includes security and versioning information. For more information about COM+ partitions, consult the COM+ documentation.

  • When enabled, the COM+ tracker allows administrators to monitor what code is running within the ASP session and when. This information is extremely helpful to debug ASP applications. For more information about the COM+ tracker, consult the COM+ documentation.

  • ASP, through COM+, allows developers to determine which threading model to use when executing the pages in an application. By default, ASP uses the Single Threaded Apartment. However, if the application uses poolable objects, it can be run in the Multi-Threaded Apartment.


   
Top


Introducing Microsoft Windows Server 2003
Introducing Microsoft Windows Server(TM) 2003
ISBN: 0735615705
EAN: 2147483647
Year: 2005
Pages: 153

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net