The ASP.NET platform provides a rich set of services for all types of Web applications. You can harness many of these features in your XML Web services just by deriving your XML Web service class from System.Web.Service.WebService. <WebService(Namespace:="http://www.prosetech.com/", _ Description:="Methods to interact with the Customers table.")> _ Public Class CustomerDB Inherits WebService By inheriting from WebService, your class gains four additional properties, as shown in Table 5-4. These features include a few heavyweights, such as authentication and caching, that we'll return to in later chapters. These prebuilt features are so useful that in many situations you'll find it easier to build a large-scale performance-optimal solution with XML Web services rather than .NET Remoting, even though .NET Remoting supports leaner binary communication.
You could also access these properties without deriving from WebService, by using the System.Web.HttpContext class. SOAP Headers and SOAP ExtensionsSOAP headers and extensions are great ways to extend the SOAP standard, and they add support for custom encryption, logging, compression, and authentication schemes. SOAP headers and extensions are also potential nightmares because they represent proprietary add-ons that you can apply to your XML Web services, potentially making them less generic and more difficult to support on other platforms. SOAP headers and extensions are also wedded to the SOAP standard, meaning you can't easily adapt a SOAP header authentication technique or SOAP extension logging approach to a .NET Remoting component that works over a TCP/IP channel with binary messages. This chapter won't discuss SOAP headers and extensions. However, Chapter 13 and Chapter 18 show how you can use SOAP headers to implement security in conjunction with a custom ticket-based authentication system. Note Microsoft is also developing a number of XML Web service extensions based on emerging SOAP standards, particularly those related to security and authentication. These are known collectively as the Web Service Enhancements (WSE) and are available at http://msdn.microsoft.com/webservices/building/wse. As these standards continue to evolve, the WSE will likely change or be incorporated into a future release of the .NET platform. |