System.Rtti.TVirtualInterface

From Appmethod Libraries
Jump to: navigation, search

System.TInterfacedObjectSystem.TObjectTVirtualInterface

Object Pascal

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 Object Pascal interface that "mirrors" the server service. On the client side, a class is created at run time that implements the Object Pascal 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 Object Pascal 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