|
Web services are supported by several namespaces in the .NET Framework, as listed in the following table.
Namespace | Description |
System::Web::Services | Contains classes used to build and use Web services |
System::Web::Services::Configuration | Contains classes that configure how Web services run |
System::Web::Services::Description | Contains classes that let you describe Web services using WSDL |
System::Web::Services::Discovery | Contains classes that let client code locate Web services elsewhere on the Web |
System::Web::Services::Protocols | Contains classes that define the protocols used to transmit data in Web services |
The System::Web::Services namespace contains the classes that you use to create and use Web services. It isn’t a large namespace, and the three main classes are listed in the following table.
Class | Description |
---|---|
WebMethodAttribute | An attribute that marks a method as callable from remote Web clients |
WebService | An optional base class used to build Web services |
WebServiceAttribute | An attribute used to add additional information to a class that implements a Web service |
Web services will often derive from WebService, but doing so is necessary only if you want access to the common Microsoft ASP.NET objects, as listed in the following table.
Property | Description |
---|---|
Application | Gets the application state object, which is common to all sessions |
Context | Gets the ASP.NET HttpContext object for the current HTTP request |
Server | Returns an HttpServerUtility object that provides utility methods for working with the Web server |
Session | Gets the HttpSessionState object for the current request |
User | Returns an ASP.NET User object, which represents the current user and can be used for authentication purposes |
If you don’t need access to these properties, you don’t need to derive a class from WebService.
|