
WebServiceAttribute | 551
Services
Namespace
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Hierarchy
System.Object ➝ System.Attribute ➝ WebMethodAttribute
Returned By
System.Web.Services.Description.ProtocolReflector.MethodAttribute
Valid On
Method
WebService
System.Web.Services (system.web.services.dll)
disposable
class
When creating a web service, you can inherit from this class to gain access to the built-
in ASP.NET objects Application (the current System.Web.HttpApplicationState collection), Server,
Session, User, and Context (which provides access to the built-in Request and Response objects).
If you don’t need to access these objects (or if you choose to go through the Context
property) you don’t need to derive your web service from this class.
When creating a web service class, all web methods must be marked with the
WebMethodAttribute. To configure additional activities, you should also add the WebServiceAt-
tribute to the class declaration.
Hierarchy
System.Object ➝ System.ComponentModel.MarshalByValueComponent(System.Compo-
nentModel.IComponent, System.IDisposable, System.IServiceProvider)
➝ WebService
WebServiceAttribute
System.Web.Services (system.web.services.dll)
sealed class
This attribute is not required to create a web service, but it should be used before a
web service is deployed to specify a unique XML namespace and ...