Extending Web Services
At times, you may need features beyond those available in the .NET Web service infrastructure. For example, you may need compression or encryption of the SOAP message; or special security processing such as that specified with WS-Security.
The Web service infrastructure comes with a special SOAP-based extension feature that enables you to extend the functionality of your Web service or Web service client. These SOAP extensions work in a manner similar to ISAPI filters. They can do everything from merely looking at the request and response SOAP messages to modifying these messages.
The nice thing about SOAP extensions is their suitability for Web services. However, for times when you need even more control than what they offer, you may want to use ASP.NET's HTTP module feature. These allow control over the network stream in a more precise manner, and with more points of control. SOAP extensions can run on both the client and the server, but modules work only for the server. This chapter looks at both of these extension features.