Export (0) Print
Expand All

request_handler

Visual Studio .NET 2003

Apply this attribute to a class to expose it as an ATL Server request handler and enable it to handle HTTP requests.

[ request_handler(
   name,
   sdl
) ]

Parameters

name (optional)
A string specifying the name of this request handler. If not specified, the name of the class is used
sdl (optional)
A string specifying the name of the compiler-generated handler that will return the WSDL for this request handler. This parameter is only valid if the soap_handler attribute is applied to the same class.

Attribute Context

Applies to coclass, class, struct
Repeatable Yes
Required attributes None
Invalid attributes None

For more information about the attribute contexts, see Attribute Contexts.

Requirements

Header atlstencil.h
Project EXE, DLL
Compiler /D "_ATL_ATTRIBUTES"

For more information about the meaning of the requirements, see Attribute Requirements.

Remarks

Use the tag_name attribute on any methods of this class that you want to expose as replacement methods.

The names specified with the name and sdl parameters can be used in a server response file or a query string to refer to the request handler. For example, the following URL would return the service description for an XML Web service (soap_handler-attributed class):

http://servername/virtualpath/dllname.dll?Handler=sdl

See soap_handler for more details on the implications of using the sdl parameter.

Details

The request_handler attribute will usually add CRequestHandlerT as a base class. If the soap_handler attribute has been applied to this class, CSoapHandler will be added as a base class instead. If the class to which this attribute is applied already derives from IRequestHandler, then no base classes will be added.

Base class added Situation
CRequestHandlerT request_handler attribute applied to class.
CSoapHandler request_handler and soap_handler attributes applied to class.
None Class already derives from IRequestHandler.
Global code added Situation
DECLARE_REQUEST_HANDLER("name", ClassName) request_handler attribute applied to class.
HANDLER_ENTRY_SDL("name", ClassName, GenClassNameWSDL) request_handler and soap_handler attributes applied to class, sdl parameter omitted.
HANDLER_ENTRY_SDL("name", ClassName, sdl) request_handler and soap_handler attributes applied to class, sdl parameter specified.

Example

See Attributed Request Handler Code. Also see the following samples:

See Also

ATL Server Attributes | COM Attributes | Class Attributes | tag_name | soap_handler | WeatherService Sample | MantaWeb Sample | Attributes Samples

Show:
© 2015 Microsoft