System.Rtti.TVirtualInterface

From RAD Studio API Documentation
Jump to: navigation, search

System.TInterfacedObjectSystem.TObjectTVirtualInterface

Delphi

TVirtualInterface = class(TInterfacedObject, IInterface)

C++

class PASCALIMPLEMENTATION TVirtualInterface : public System::TInterfacedObject

Properties

Type Visibility Source Unit Parent
class public
System.Rtti.pas
System.Rtti.hpp
System.Rtti System.Rtti

Description

Provides functionality for remote procedure call marshaling.

TVirtualInterface creates an implementation of an interface at run time. All interface methods raise an OnInvoke event (see TVirtualInterfaceInvokeEvent.)

The main application area of TVirtualInterface is SOAP messaging. The SOAP server declares a service with specific functions. The WSDL importer creates a Delphi interface that "mirrors" the server service. On the client side, a class is created at run time that implements the Delphi interface that reflects the server service (TVirtualInterface). When a method of this class is called, the call is packed in a SOAP envelope, sent to the server, decoded, and the result is sent back to the Delphi client.

TVirtualInterface doesn't behave like an ordinary class. Each instance has an associated reference counter to automatically free itself. The constructor doesn't increment the reference counter. A TVirtualInterface instance should be cast to an interface instance immediately after construction (or QueryInterface should be used).

See Also

Code Examples