unit uPSI_InvokeRegistry;
{
This file has been generated by UnitParser v0.7, written by M. Knight
and updated by NP. v/d Spek and George Birbilis. 
Source Code from Carlo Kok has been used to implement various sections of
UnitParser. Components of ROPS are used in the construction of UnitParser,
code implementing the class wrapper is taken from Carlo Kok's conv utility

}
interface
 

 
uses
   SysUtils
  ,Classes
  ,uPSComponent
  ,uPSRuntime
  ,uPSCompiler
  ;
 
type 
(*----------------------------------------------------------------------------*)
  TPSImport_InvokeRegistry = class(TPSPlugin)
  public
    procedure CompileImport1(CompExec: TPSScript); override;
    procedure ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); override;
  end;
 
 
{ compile-time registration functions }
procedure SIRegister_TInvContext(CL: TPSPascalCompiler);
procedure SIRegister_TDataContext(CL: TPSPascalCompiler);
procedure SIRegister_TRemotableTypeRegistry(CL: TPSPascalCompiler);
procedure SIRegister_TInvokableClassRegistry(CL: TPSPascalCompiler);
procedure SIRegister_TInvokableClass(CL: TPSPascalCompiler);
procedure SIRegister_TSOAPHeaders(CL: TPSPascalCompiler);
procedure SIRegister_TSOAPHeadersBase(CL: TPSPascalCompiler);
procedure SIRegister_ISOAPHeaders(CL: TPSPascalCompiler);
procedure SIRegister_IHeadersSetter(CL: TPSPascalCompiler);
procedure SIRegister_THeaderList(CL: TPSPascalCompiler);
procedure SIRegister_TSOAPAttachment(CL: TPSPascalCompiler);
procedure SIRegister_TSOAPHeader(CL: TPSPascalCompiler);
procedure SIRegister_TRemotableXS(CL: TPSPascalCompiler);
procedure SIRegister_TRemotable(CL: TPSPascalCompiler);
procedure SIRegister_IObjConverter(CL: TPSPascalCompiler);
procedure SIRegister_InvokeRegistry(CL: TPSPascalCompiler);

{ run-time registration functions }
procedure RIRegister_InvokeRegistry_Routines(S: TPSExec);
procedure RIRegister_TInvContext(CL: TPSRuntimeClassImporter);
procedure RIRegister_TDataContext(CL: TPSRuntimeClassImporter);
procedure RIRegister_TRemotableTypeRegistry(CL: TPSRuntimeClassImporter);
procedure RIRegister_TInvokableClassRegistry(CL: TPSRuntimeClassImporter);
procedure RIRegister_TInvokableClass(CL: TPSRuntimeClassImporter);
procedure RIRegister_TSOAPHeaders(CL: TPSRuntimeClassImporter);
procedure RIRegister_TSOAPHeadersBase(CL: TPSRuntimeClassImporter);
procedure RIRegister_THeaderList(CL: TPSRuntimeClassImporter);
procedure RIRegister_TSOAPAttachment(CL: TPSRuntimeClassImporter);
procedure RIRegister_TSOAPHeader(CL: TPSRuntimeClassImporter);
procedure RIRegister_TRemotableXS(CL: TPSRuntimeClassImporter);
procedure RIRegister_TRemotable(CL: TPSRuntimeClassImporter);
procedure RIRegister_InvokeRegistry(CL: TPSRuntimeClassImporter);

procedure Register;

implementation


uses
   InvokeRegistry
  ;
 
 
procedure Register;
begin
  RegisterComponents('Pascal Script', [TPSImport_InvokeRegistry]);
end;

(* === compile-time registration functions === *)
(*----------------------------------------------------------------------------*)
Function BoolToStr(value : boolean) : string;
Begin If value then Result := 'TRUE' else Result := 'FALSE' End;

(*----------------------------------------------------------------------------*)
procedure SIRegister_TInvContext(CL: TPSPascalCompiler);
begin
  //with RegClassS(CL,'TDataContext', 'TInvContext') do
  with CL.AddClassN(CL.FindClass('TDataContext'),'TInvContext') do
  begin
    RegisterMethod('Procedure SetMethodInfo( const MD : TIntfMethEntry)');
    RegisterMethod('Procedure SetParamPointer( Param : Integer; P : Pointer)');
    RegisterMethod('Function GetParamPointer( Param : Integer) : Pointer');
    RegisterMethod('Function GetResultPointer : Pointer');
    RegisterMethod('Procedure SetResultPointer( P : Pointer)');
    RegisterMethod('Procedure AllocServerData( const MD : TIntfMethEntry)');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_TDataContext(CL: TPSPascalCompiler);
begin
  //with RegClassS(CL,'TOBJECT', 'TDataContext') do
  with CL.AddClassN(CL.FindClass('TOBJECT'),'TDataContext') do
  begin
    RegisterMethod('Constructor Create');
    RegisterMethod('Function AllocData( Size : Integer) : Pointer');
    RegisterMethod('Procedure SetDataPointer( Index : Integer; P : Pointer)');
    RegisterMethod('Function GetDataPointer( Index : Integer) : Pointer');
    RegisterMethod('Procedure AddObjectToDestroy( Obj : TObject)');
    RegisterMethod('Procedure RemoveObjectToDestroy( Obj : TObject)');
    RegisterMethod('Procedure AddDynArrayToClear( P : Pointer; Info : PTypeInfo)');
    RegisterMethod('Procedure AddVariantToClear( P : PVarData)');
    RegisterMethod('Procedure AddStrToClear( P : Pointer)');
    RegisterMethod('Procedure AddWStrToClear( P : Pointer)');
    RegisterMethod('Procedure AddUStrToClear( P : Pointer)');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_TRemotableTypeRegistry(CL: TPSPascalCompiler);
begin
  //with RegClassS(CL,'TOBJECT', 'TRemotableTypeRegistry') do
  with CL.AddClassN(CL.FindClass('TOBJECT'),'TRemotableTypeRegistry') do
  begin
    RegisterMethod('Constructor Create');
    RegisterMethod('Procedure RegisterXSClass( AClass : TClass; const URI : InvString; const Name : InvString; const ExtName : InvString; IsScalar : Boolean; MultiRefOpt : TObjMultiOptions)');
    RegisterMethod('Procedure RegisterXSInfo( Info : PTypeInfo; const URI : InvString; const Name : InvString; const ExtName : InvString)');
    RegisterMethod('Procedure RegisterHolderClsMember( ClsTypeInfo : PTypeInfo; const URI : InvString; const Name : InvString; const ExtName : InvString)');
    RegisterMethod('Function ClassToURI27( AClass : TClass; var URI, Name : InvString; var IsScalar : Boolean; tryToRegister : Boolean) : Boolean;');
    RegisterMethod('Function ClassToURI28( AClass : TClass; var URI, Name : InvString) : Boolean;');
    RegisterMethod('Function InfoToURI( Info : PTypeInfo; var URI, Name : InvString; var IsScalar : Boolean; tryToRegister : Boolean) : Boolean');
    RegisterMethod('Function TypeInfoToXSD( Info : PTypeInfo; var URI, TypeName : InvString) : Boolean');
    RegisterMethod('Procedure GetXSDInfoForClass( Info : PTypeInfo; var URI, TypeName : InvString)');
    RegisterMethod('Function URIToClass29( const URI, Name : InvString; var IsScalar : Boolean) : TClass;');
    RegisterMethod('Function URIToClass30( const URI, Name : InvString) : TClass;');
    RegisterMethod('Function XSDToTypeInfo( const URI, TypeName : InvString) : PTypeInfo');
    RegisterMethod('Function URIToInfo( const URI, Name : InvString) : PTypeInfo');
    RegisterMethod('Function GetURICount : Integer');
    RegisterMethod('Function GetURIMap31( Index : Integer) : TRemRegEntry;');
    RegisterMethod('Function GetURIMap32( Index : Integer; out RegEntry : TRemRegEntry) : boolean;');
    RegisterMethod('Function IsClassScalar( AClass : TClass) : Boolean');
    RegisterMethod('Function ClassOptions( AClass : TClass) : TObjMultiOptions');
    RegisterMethod('Function VariantToInfo( const V : Variant; TryAllSchema : Boolean) : PTypeInfo');
    RegisterMethod('Function GetVarTypeFromXSD( const URI, TypeName : InvString) : TVarType');
    RegisterMethod('Procedure RegisterSerializeOptions33( Info : PTypeInfo; SerialOpt : TSerializationOptions);');
    RegisterMethod('Function SerializeOptions34( Info : PTypeInfo) : TSerializationOptions;');
    RegisterMethod('Procedure RegisterSerializeOptions35( AClass : TClass; SerialOpt : TSerializationOptions);');
    RegisterMethod('Function SerializeOptions36( AClass : TClass) : TSerializationOptions;');
    RegisterMethod('Procedure UnRegisterXSClass( AClass : TClass)');
    RegisterMethod('Procedure UnRegisterXSInfo( Info : PTypeInfo)');
    RegisterMethod('Procedure RegisterExternalPropName( Info : PTypeInfo; const InternalName : string; const ExternalName : InvString)');
    RegisterMethod('Function GetExternalPropName( Info : PTypeInfo; InternalName : string) : InvString');
    RegisterMethod('Function GetInternalPropName( Info : PTypeInfo; const ExternalName : InvString) : string');
    RegisterProperty('AutoRegisterNativeTypes', 'Boolean', iptrw);
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_TInvokableClassRegistry(CL: TPSPascalCompiler);
begin
  //with RegClassS(CL,'TOBJECT', 'TInvokableClassRegistry') do
  with CL.AddClassN(CL.FindClass('TOBJECT'),'TInvokableClassRegistry') do
  begin
    RegisterMethod('Constructor Create');
    RegisterMethod('Procedure RegisterInterface( Info : PTypeInfo; const Namespace : InvString; const WSDLEncoding : InvString; const Doc : string; const ExtName : InvString)');
    RegisterMethod('Procedure RegisterHeaderClass8( Info : PTypeInfo; AClass : TClass; const HeaderName : InvString; const HeaderNamespace : InvString; DefaultMethodType : eHeaderMethodType; Required : Boolean);');
    RegisterMethod('Procedure RegisterHeaderClass9( Info : PTypeInfo; AClass : TClass; DefaultMethodType : eHeaderMethodType; Required : Boolean);');
    RegisterMethod('Procedure RegisterHeaderMethod10( Info : PTypeInfo; AClass : TClass; const MethodName : string; MethodType : eHeaderMethodType; Required : Boolean);');
    RegisterMethod('Function GetHeaderInfoForInterface( Info : PTypeInfo; MethodType : eHeaderMethodType) : THeaderItemArray');
    RegisterMethod('Function GetRequestHeaderInfoForInterface( Info : PTypeInfo) : THeaderItemArray');
    RegisterMethod('Function GetResponseHeaderInfoForInterface( Info : PTypeInfo) : THeaderItemArray');
    RegisterMethod('Function GetHeaderName( Info : PTypeInfo; AClass : TClass) : InvString');
    RegisterMethod('Function GetHeaderNamespace11( Info : PTypeInfo; AClass : TClass) : InvString;');
    RegisterMethod('Function GetHeaderNamespace12( AClass : TClass) : InvString;');
    RegisterMethod('Function GetHeaderClass( Name, Namespace : InvString) : TClass');
    RegisterMethod('Procedure RegisterException( Info : PTypeInfo; AClass : TClass)');
    RegisterMethod('Procedure RegisterExceptionMethod( Info : PTypeInfo; AClass : TClass; const MethodName : string)');
    RegisterMethod('Function GetExceptionInfoForInterface( Info : PTypeInfo) : TExceptionItemArray');
    RegisterMethod('Procedure RegisterInvokableClass13( AClass : TClass; CreateProc : TCreateInstanceProc);');
    RegisterMethod('Procedure RegisterInvokableClass14( AClass : TClass);');
    RegisterMethod('Procedure RegisterExternalParamName( Info : PTypeInfo; const MethodName, InternalName : string; const ExternalName : InvString)');
    RegisterMethod('Procedure RegisterParamInfo( Info : PTypeInfo; const MethodName, InternalParamName : string; const ExternalParamName, Namespace : InvString; XMLOptions : Integer)');
    RegisterMethod('Procedure GetParamInfo( Info : PTypeInfo; const MethodName, InternalParamName : string; var ExternalParamName, Namespace : InvString; var XMLOptions : Integer)');
    RegisterMethod('Procedure RegisterExternalMethName( Info : PTypeInfo; const InternalName : string; const ExternalName : InvString)');
    RegisterMethod('Procedure RegisterMethodInfo( Info : PTypeInfo; const InternalName, ExternalName, ReturnName : string; XMLOptions : Integer)');
    RegisterMethod('Procedure GetMethodInfo( Info : PTypeInfo; const InternalName : string; var ExternalName, ReturnName : string; var XMLOptions : Integer)');
    RegisterMethod('Procedure RegisterDefaultSOAPAction( Info : PTypeInfo; const DefSOAPAction : InvString)');
    RegisterMethod('Procedure RegisterAllSOAPActions( Info : PTypeInfo; const AllSOAPActions : InvString)');
    RegisterMethod('Function GetActionURIOfInfo( const IntfInfo : PTypeInfo; const MethodName : InvString; MethodIndex : Integer) : string');
    RegisterMethod('Function GetActionURIOfIID( const AGUID : TGUID) : string');
    RegisterMethod('Procedure RegisterUDDIInfo( Info : PTypeInfo; const Operator : String; const BindingKey : string)');
    RegisterMethod('Function GetUDDIInfo15( const IntfInfo : PTypeInfo; var Operator, BindingKey : string) : Boolean;');
    RegisterMethod('Function GetUDDIInfo16( const AGUID : TGUID; var Operator, BindingKey : string) : Boolean;');
    RegisterMethod('Procedure RegisterReturnParamNames( Info : PTypeInfo; const RetParamNames : InvString)');
    RegisterMethod('Function GetReturnParamNames( const IntfInfo : PTypeInfo) : InvString');
    RegisterMethod('Procedure RegisterInvokeOptions17( Info : PTypeInfo; const InvokeOption : TIntfInvokeOption);');
    RegisterMethod('Procedure RegisterInvokeOptions18( Info : PTypeInfo; const InvokeOptions : TIntfInvokeOptions);');
    RegisterMethod('Function GetNamespaceByGUID( const AGUID : TGUID) : string');
    RegisterMethod('Function GetInfoForURI( const PathURI, ActionURI : string; var ACLass : TClass; var IntfInfo : PTypeInfo; var AMeth : string) : Boolean');
    RegisterMethod('Function GetIntfInvokeOptions19( const IntfInfo : PTypeInfo) : TIntfInvokeOptions;');
    RegisterMethod('Function GetIntfInvokeOptions20( const AGUID : TGUID) : TIntfInvokeOptions;');
    RegisterMethod('Procedure GetInterfaceInfoFromName( const UnitName, IntfName : string; var Info : PTypeInfo; var IID : TGUID)');
    RegisterMethod('Function GetInterfaceTypeInfo( const AGUID : TGUID) : Pointer');
    RegisterMethod('Function GetInvokableObjectFromClass( AClass : TClass) : TObject');
    RegisterMethod('Function GetRegInterfaceEntry( Index : Integer) : InterfaceMapItem');
    RegisterMethod('Function HasRegInterfaceImpl( Index : Integer) : Boolean');
    RegisterMethod('Procedure GetClassFromIntfInfo( Info : PTypeInfo; var AClass : TClass)');
    RegisterMethod('Function GetInterfaceCount : Integer');
    RegisterMethod('Function GetInterfaceExternalName21( Info : PTypeInfo; const Namespace : string; const InternalIntfName : string) : InvString;');
    RegisterMethod('Function GetInterfaceExternalName22( Info : PTypeInfo; const Namespace : string) : InvString;');
    RegisterMethod('Function GetInterfaceExternalName23( Info : PTypeInfo) : InvString;');
    RegisterMethod('Function GetWSDLEncoding24( Info : PTypeInfo; const Namespace : string; const InternalIntfName : string) : InvString;');
    RegisterMethod('Function GetWSDLEncoding25( Info : PTypeInfo; const Namespace : string) : InvString;');
    RegisterMethod('Function GetWSDLEncoding26( Info : PTypeInfo) : InvString;');
    RegisterMethod('Procedure UnRegisterInterface( Info : PTypeInfo)');
    RegisterMethod('Procedure UnRegisterInvokableClass( AClass : TClass)');
    RegisterMethod('Function GetParamExternalName( Info : PTypeInfo; const MethodName, InternalParamName : string) : InvString');
    RegisterMethod('Function GetParamInternalName( Info : PTypeInfo; const MethodName : string; const ExternalParamName : InvString) : string');
    RegisterMethod('Function GetMethExternalName( Info : PTypeInfo; const MethodIntName : string) : InvString');
    RegisterMethod('Function GetMethInternalName( Info : PTypeInfo; const MethodExtName : InvString) : string');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_TInvokableClass(CL: TPSPascalCompiler);
begin
  //with RegClassS(CL,'TInterfacedObject', 'TInvokableClass') do
  with CL.AddClassN(CL.FindClass('TInterfacedObject'),'TInvokableClass') do
  begin
    RegisterMethod('Constructor Create');
    RegisterProperty('RefCount', 'Integer', iptr);
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_TSOAPHeaders(CL: TPSPascalCompiler);
begin
  //with RegClassS(CL,'TSOAPHeadersBase', 'TSOAPHeaders') do
  with CL.AddClassN(CL.FindClass('TSOAPHeadersBase'),'TSOAPHeaders') do
  begin
    RegisterMethod('Procedure Send( const Hdr : TSOAPHeader)');
    RegisterMethod('Function SendCount : Integer');
    RegisterMethod('Function SendAt( Index : Integer) : TSOAPHeader');
    RegisterMethod('Procedure Get5( Cls : TClass; out Hdr : TSOAPHeader);');
    RegisterMethod('Function Get6( Cls : TClass) : TSOAPHeader;');
    RegisterMethod('Function Get7( const Name, URI : InvString) : TSOAPHeader;');
    RegisterMethod('Function GetOwnsSentHeaders : Boolean');
    RegisterMethod('Procedure SetOwnsSentHeaders( Flag : Boolean)');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_TSOAPHeadersBase(CL: TPSPascalCompiler);
begin
  //with RegClassS(CL,'TContainedObject', 'TSOAPHeadersBase') do
  with CL.AddClassN(CL.FindClass('TContainedObject'),'TSOAPHeadersBase') do
  begin
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_ISOAPHeaders(CL: TPSPascalCompiler);
begin
  //with RegInterfaceS(CL,'IUNKNOWN', 'ISOAPHeaders') do
  with CL.AddInterface(CL.FindInterface('IUNKNOWN'),ISOAPHeaders, 'ISOAPHeaders') do
  begin
    RegisterMethod('Procedure Send( const Hdr : TSOAPHeader)', cdRegister);
    RegisterMethod('Function SendCount : Integer', cdRegister);
    RegisterMethod('Function SendAt( Index : Integer) : TSOAPHeader', cdRegister);
    RegisterMethod('Procedure Get2( Cls : TClass; out Hdr : TSOAPHeader);', cdRegister);
    RegisterMethod('Function Get3( Cls : TClass) : TSOAPHeader;', cdRegister);
    RegisterMethod('Function Get4( const Name, URI : InvString) : TSOAPHeader;', cdRegister);
    RegisterMethod('Function GetOwnsSentHeaders : Boolean', cdRegister);
    RegisterMethod('Procedure SetOwnsSentHeaders( Flag : Boolean)', cdRegister);
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_IHeadersSetter(CL: TPSPascalCompiler);
begin
  //with RegInterfaceS(CL,'IUNKNOWN', 'IHeadersSetter') do
  with CL.AddInterface(CL.FindInterface('IUNKNOWN'),IHeadersSetter, 'IHeadersSetter') do
  begin
    RegisterMethod('Procedure SetHeadersInOut( var InHdrs, OutHdrs : THeaderList)', cdRegister);
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_THeaderList(CL: TPSPascalCompiler);
begin
  //with RegClassS(CL,'TOBJECT', 'THeaderList') do
  with CL.AddClassN(CL.FindClass('TOBJECT'),'THeaderList') do
  begin
    RegisterMethod('Constructor Create');
    RegisterMethod('Procedure Add0( Header : TSOAPHeader);');
    RegisterMethod('Procedure Add1( Header : TObject);');
    RegisterMethod('Procedure Clear');
    RegisterMethod('Function Extract( Obj : TObject) : TObject');
    RegisterMethod('Function IndexOf( Obj : TObject) : Integer');
    RegisterProperty('Count', 'Integer', iptr);
    RegisterProperty('OwnsObjects', 'Boolean', iptrw);
    RegisterProperty('Headers', 'TObject Integer', iptr);
    SetDefaultPropery('Headers');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_TSOAPAttachment(CL: TPSPascalCompiler);
begin
  //with RegClassS(CL,'TRemotable', 'TSOAPAttachment') do
  with CL.AddClassN(CL.FindClass('TRemotable'),'TSOAPAttachment') do
  begin
    RegisterMethod('Procedure Init( ATempLocation : string; AHeaders : TStrings; AContentType : String; AEncoding : InvString)');
    RegisterProperty('CacheFile', 'string', iptr);
    RegisterProperty('CacheFilePersist', 'Boolean', iptrw);
    RegisterProperty('ContentType', 'string', iptrw);
    RegisterProperty('Encoding', 'InvString', iptrw);
    RegisterProperty('Headers', 'TStrings', iptr);
    RegisterProperty('Ownership', 'TStreamOwnership', iptrw);
    RegisterProperty('SourceStream', 'TStream', iptr);
    RegisterProperty('SourceString', 'string', iptrw);
    RegisterMethod('Procedure SaveToStream( AStream : TStream)');
    RegisterMethod('Procedure SaveToFile( AFileName : string)');
    RegisterMethod('Procedure SetSourceFile( const Value : string)');
    RegisterMethod('Procedure SetSourceStream( const Value : TStream; const Ownership : TStreamOwnership)');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_TSOAPHeader(CL: TPSPascalCompiler);
begin
  //with RegClassS(CL,'TRemotable', 'TSOAPHeader') do
  with CL.AddClassN(CL.FindClass('TRemotable'),'TSOAPHeader') do
  begin
    RegisterProperty('MustUnderstand', 'Boolean', iptrw);
    RegisterProperty('Actor', 'InvString', iptrw);
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_TRemotableXS(CL: TPSPascalCompiler);
begin
  //with RegClassS(CL,'TRemotable', 'TRemotableXS') do
  with CL.AddClassN(CL.FindClass('TRemotable'),'TRemotableXS') do
  begin
    RegisterMethod('Function NativeToXS : InvString');
    RegisterMethod('Procedure XSToNative( const Data : InvString)');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_TRemotable(CL: TPSPascalCompiler);
begin
  //with RegClassS(CL,'TOBJECT', 'TRemotable') do
  with CL.AddClassN(CL.FindClass('TOBJECT'),'TRemotable') do
  begin
    RegisterMethod('Constructor Create');
    RegisterMethod('Function ObjectToSOAP( RootNode, ParentNode : IXMLNode; const ObjConverter : IObjConverter; const NodeName, NodeNamespace, ChildNamespace : InvString; ObjConvOpts : TObjectConvertOptions; out RefID : ' +
      'InvString) : IXMLNode');
    RegisterMethod('Procedure SOAPToObject( const RootNode, Node : IXMLNode; const ObjConverter : IObjConverter)');
    RegisterProperty('DataContext', 'TDataContext', iptrw);
    RegisterProperty('SerializationOptions', 'TSerializationOptions', iptr);
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_IObjConverter(CL: TPSPascalCompiler);
begin
  //with RegInterfaceS(CL,'IUNKNOWN', 'IObjConverter') do
  with CL.AddInterface(CL.FindInterface('IUNKNOWN'),IObjConverter, 'IObjConverter') do
  begin
    RegisterMethod('Function ObjInstanceToSOAP( Instance : TObject; RootNode, ParentNode : IXMLNode; const NodeName, NodeNamespace, ChildNamespace : InvString; ObjConvOpts : TObjectConvertOptions; out RefID : InvString) ' +
      ': IXMLNode', cdRegister);
    RegisterMethod('Procedure InitObjectFromSOAP( Instance : TObject; RootNode, Node : IXMLNode)', cdRegister);
    RegisterMethod('Procedure AddAttachment( Attachment : TSOAPAttachment; const AContentId : string)', cdRegister);
    RegisterMethod('Function FindAttachment( const AContentId : string) : TSOAPAttachment', cdRegister);
    RegisterMethod('Procedure ResetMultiRef', cdRegister);
    RegisterMethod('Function GetOptions : TSOAPConvertOptions', cdRegister);
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_InvokeRegistry(CL: TPSPascalCompiler);
begin
  CL.AddTypeS('InvString', 'WideString');
  CL.AddTypeS('InvString', 'DOMString');
  CL.AddTypeS('InvStringDynArray', 'array of InvString');
  CL.AddClassN(CL.FindClass('TOBJECT'),'TDataContext');
  CL.AddTypeS('ObjectConvertOptions', '( ocoDontPrefixNode, ocoDontSerializePro'
   +'ps, ocoDontPutTypeAttr )');
  CL.AddTypeS('TObjectConvertOptions', 'set of ObjectConvertOptions');
  CL.AddClassN(CL.FindClass('TOBJECT'),'TSOAPAttachment');
  SIRegister_IObjConverter(CL);
  CL.AddTypeS('SerializationOptions', '( xoHolderClass, xoAttributeOnLastMember'
   +', xoInlineArrays, xoLiteralParam, xoSimpleTypeWrapper, xoOption6, xoOption'
   +'7, xoOption8, xoOption9, xoOptionA, xoOptionB, xoOptionC, xoOptionD, xoOpt'
   +'ionE, xoOptionF, xoOptionG, xoOptionH, xoOptionI )');
  CL.AddTypeS('TSerializationOptions', 'set of SerializationOptions');
  SIRegister_TRemotable(CL);
  SIRegister_TRemotableXS(CL);
  CL.AddTypeS('PTRemotable', '^TRemotable // will not work');
  //CL.AddTypeS('TRemotableClass', 'class of TRemotable');
  //CL.AddTypeS('TRemotableXSClass', 'class of TRemotableXS');
  SIRegister_TSOAPHeader(CL);
  //CL.AddTypeS('TSOAPHeaderClass', 'class of TSOAPHeader');
  //CL.AddTypeS('ERemotableExceptionClass', 'class of ERemotableException');
  SIRegister_TSOAPAttachment(CL);
  //CL.AddTypeS('TSOAPAttachmentClass', 'class of TSOAPAttachment');
  SIRegister_THeaderList(CL);
  SIRegister_IHeadersSetter(CL);
  SIRegister_ISOAPHeaders(CL);
  SIRegister_TSOAPHeadersBase(CL);
  SIRegister_TSOAPHeaders(CL);
  SIRegister_TInvokableClass(CL);
  //CL.AddTypeS('TInvokableClassClass', 'class of TInvokableClass');
  CL.AddTypeS('InvRegClassEntry', 'record ClassType : TClass; Proc : TCreateIns'
   +'tanceProc; URI : string; end');
  CL.AddTypeS('ExtNameMapItem', 'record Name : string; ExtName : InvString; end');
  CL.AddTypeS('eHeaderMethodType', '( hmtAll, hmtRequest, hmtResponse )');
  CL.AddTypeS('THeaderMethodTypeArray', 'array of eHeaderMethodType');
  CL.AddTypeS('TRequiredArray', 'array of Boolean');
  CL.AddTypeS('IntfHeaderItem', 'record Info : PTypeInfo; ClassType : TClass; N'
   +'amespace : InvString; Name : InvString; DefaultMethodType : eHeaderMethodT'
   +'ype; DefaultRequired : Boolean; MethodNames : string; MethodTypes : THeade'
   +'rMethodTypeArray; HeaderRequired : TRequiredArray; end');
  CL.AddTypeS('THeaderItemArray', 'array of IntfHeaderItem');
  CL.AddTypeS('IntfExceptionItem', 'record ClassType : TClass; MethodNames : st'
   +'ring; end');
  CL.AddTypeS('TExceptionItemArray', 'array of IntfExceptionItem');
  CL.AddTypeS('TIntfInvokeOption', '( ioDefault, ioDocument, ioLiteral, ioHasDe'
   +'faultSOAPAction, ioHasReturnParamNames, ioHasNamespace, ioIsAppServerSOAP,'
   +' ioHasUDDIInfo, ioHasAllSOAPActions, ioSOAP12 )');
  CL.AddTypeS('TIntfInvokeOptions', 'set of TIntfInvokeOption');
  CL.AddTypeS('ParameterMapItem', 'record Name : string; ExtName : InvString; N'
   +'amespace : InvString; XMLOptions : Integer; end');
  CL.AddTypeS('MethodMapItem', 'record Name : string; ExtName : InvString; Retu'
   +'rnName : InvString; XMLOptions : Integer; Parameters : array of ParameterM'
   +'apItem; end');
  CL.AddTypeS('InterfaceMapItem', 'record Name : string; ExtName : InvString; U'
   +'nitName : string; GUID : TGUID; Info : PTypeInfo; DefImpl : TClass; Namesp'
   +'ace : InvString; WSDLEncoding : InvString; Documentation : string; SOAPAct'
   +'ion : string; ReturnParamNames : InvString; ReturnParamNames : string; Inv'
   +'okeOptions : TIntfInvokeOptions; Methods : array of MethodMapItem; IntfHea'
   +'ders : array of IntfHeaderItem; IntfExceptions : array of IntfExceptionIte'
   +'m; UDDIOperator : String; UDDIBindingKey : String; end');
  CL.AddTypeS('TInterfaceMapItemArray', 'array of InterfaceMapItem');
  SIRegister_TInvokableClassRegistry(CL);
  CL.AddTypeS('TRemHeaderEntry', 'record Name : InvString; ExtName : InvString;'
   +' URI : InvString; end');
  CL.AddTypeS('TObjMultiOptions', '( ocDefault, ocMultiRef, ocNoMultiRef )');
  CL.AddTypeS('TRemRegEntry', 'record ClassType : TClass; Info : PTypeInfo; URI'
   +' : InvString; Name : InvString; ExtName : InvString; IsScalar : Boolean; M'
   +'ultiRefOpt : TObjMultiOptions; SerializationOpt : TSerializationOptions; P'
   +'ropNameMap : array of ExtNameMapItem; end');
  CL.AddTypeS('TRemRegEntryArray', 'array of TRemRegEntry');
  CL.AddClassN(CL.FindClass('TOBJECT'),'ETypeRegistryException');
  SIRegister_TRemotableTypeRegistry(CL);
  CL.AddTypeS('TRemotableClassRegistry', 'TRemotableTypeRegistry');
  CL.AddTypeS('TPascalRemotableTypeRegistry', 'TRemotableTypeRegistry');
  CL.AddTypeS('TPascalRemotableClassRegistry', 'TRemotableTypeRegistry');
  CL.AddTypeS('TDynToClear', 'record P : Pointer; Info : PTypeInfo; end');
  SIRegister_TDataContext(CL);
  SIRegister_TInvContext(CL);
 CL.AddDelphiFunction('Function GetRemotableDataContext : Pointer');
 CL.AddDelphiFunction('Procedure SetRemotableDataContext( Value : Pointer)');
 CL.AddDelphiFunction('Function InvRegistry : TInvokableClassRegistry');
 CL.AddDelphiFunction('Function RemClassRegistry : TRemotableClassRegistry');
 CL.AddDelphiFunction('Function RemTypeRegistry : TRemotableTypeRegistry');
 CL.AddDelphiFunction('Function SubstituteStrings( const InputString : string; const SubString : string; const Replacement : string) : string');
 CL.AddDelphiFunction('Function SubstituteStrings( const InputString : WideString; const SubString : WideString; const Replacement : WideString) : WideString');
 CL.AddConstantN('AS_ATTRIBUTE','Boolean')BoolToStr( False);
end;

(* === run-time registration functions === *)
(*----------------------------------------------------------------------------*)
procedure TRemotableTypeRegistryAutoRegisterNativeTypes_W(Self: TRemotableTypeRegistry; const T: Boolean);
begin Self.AutoRegisterNativeTypes := T; end;

(*----------------------------------------------------------------------------*)
procedure TRemotableTypeRegistryAutoRegisterNativeTypes_R(Self: TRemotableTypeRegistry; var T: Boolean);
begin T := Self.AutoRegisterNativeTypes; end;

(*----------------------------------------------------------------------------*)
Function TRemotableTypeRegistrySerializeOptions36_P(Self: TRemotableTypeRegistry;  AClass : TClass) : TSerializationOptions;
Begin Result := Self.SerializeOptions(AClass); END;

(*----------------------------------------------------------------------------*)
Procedure TRemotableTypeRegistryRegisterSerializeOptions35_P(Self: TRemotableTypeRegistry;  AClass : TClass; SerialOpt : TSerializationOptions);
Begin Self.RegisterSerializeOptions(AClass, SerialOpt); END;

(*----------------------------------------------------------------------------*)
Function TRemotableTypeRegistrySerializeOptions34_P(Self: TRemotableTypeRegistry;  Info : PTypeInfo) : TSerializationOptions;
Begin Result := Self.SerializeOptions(Info); END;

(*----------------------------------------------------------------------------*)
Procedure TRemotableTypeRegistryRegisterSerializeOptions33_P(Self: TRemotableTypeRegistry;  Info : PTypeInfo; SerialOpt : TSerializationOptions);
Begin Self.RegisterSerializeOptions(Info, SerialOpt); END;

(*----------------------------------------------------------------------------*)
Function TRemotableTypeRegistryGetURIMap32_P(Self: TRemotableTypeRegistry;  Index : Integer; out RegEntry : TRemRegEntry) : boolean;
Begin Result := Self.GetURIMap(Index, RegEntry); END;

(*----------------------------------------------------------------------------*)
Function TRemotableTypeRegistryGetURIMap31_P(Self: TRemotableTypeRegistry;  Index : Integer) : TRemRegEntry;
Begin Result := Self.GetURIMap(Index); END;

(*----------------------------------------------------------------------------*)
Function TRemotableTypeRegistryURIToClass30_P(Self: TRemotableTypeRegistry;  const URI, Name : InvString) : TClass;
Begin Result := Self.URIToClass(URI, Name); END;

(*----------------------------------------------------------------------------*)
Function TRemotableTypeRegistryURIToClass29_P(Self: TRemotableTypeRegistry;  const URI, Name : InvString; var IsScalar : Boolean) : TClass;
Begin Result := Self.URIToClass(URI, Name, IsScalar); END;

(*----------------------------------------------------------------------------*)
Function TRemotableTypeRegistryClassToURI28_P(Self: TRemotableTypeRegistry;  AClass : TClass; var URI, Name : InvString) : Boolean;
Begin Result := Self.ClassToURI(AClass, URI, Name); END;

(*----------------------------------------------------------------------------*)
Function TRemotableTypeRegistryClassToURI27_P(Self: TRemotableTypeRegistry;  AClass : TClass; var URI, Name : InvString; var IsScalar : Boolean; tryToRegister : Boolean) : Boolean;
Begin Result := Self.ClassToURI(AClass, URI, Name, IsScalar, tryToRegister); END;

(*----------------------------------------------------------------------------*)
Function TInvokableClassRegistryGetWSDLEncoding26_P(Self: TInvokableClassRegistry;  Info : PTypeInfo) : InvString;
Begin Result := Self.GetWSDLEncoding(Info); END;

(*----------------------------------------------------------------------------*)
Function TInvokableClassRegistryGetWSDLEncoding25_P(Self: TInvokableClassRegistry;  Info : PTypeInfo; const Namespace : string) : InvString;
Begin Result := Self.GetWSDLEncoding(Info, Namespace); END;

(*----------------------------------------------------------------------------*)
Function TInvokableClassRegistryGetWSDLEncoding24_P(Self: TInvokableClassRegistry;  Info : PTypeInfo; const Namespace : string; const InternalIntfName : string) : InvString;
Begin Result := Self.GetWSDLEncoding(Info, Namespace, InternalIntfName); END;

(*----------------------------------------------------------------------------*)
Function TInvokableClassRegistryGetInterfaceExternalName23_P(Self: TInvokableClassRegistry;  Info : PTypeInfo) : InvString;
Begin Result := Self.GetInterfaceExternalName(Info); END;

(*----------------------------------------------------------------------------*)
Function TInvokableClassRegistryGetInterfaceExternalName22_P(Self: TInvokableClassRegistry;  Info : PTypeInfo; const Namespace : string) : InvString;
Begin Result := Self.GetInterfaceExternalName(Info, Namespace); END;

(*----------------------------------------------------------------------------*)
Function TInvokableClassRegistryGetInterfaceExternalName21_P(Self: TInvokableClassRegistry;  Info : PTypeInfo; const Namespace : string; const InternalIntfName : string) : InvString;
Begin Result := Self.GetInterfaceExternalName(Info, Namespace, InternalIntfName); END;

(*----------------------------------------------------------------------------*)
Function TInvokableClassRegistryGetIntfInvokeOptions20_P(Self: TInvokableClassRegistry;  const AGUID : TGUID) : TIntfInvokeOptions;
Begin Result := Self.GetIntfInvokeOptions(AGUID); END;

(*----------------------------------------------------------------------------*)
Function TInvokableClassRegistryGetIntfInvokeOptions19_P(Self: TInvokableClassRegistry;  const IntfInfo : PTypeInfo) : TIntfInvokeOptions;
Begin Result := Self.GetIntfInvokeOptions(IntfInfo); END;

(*----------------------------------------------------------------------------*)
Procedure TInvokableClassRegistryRegisterInvokeOptions18_P(Self: TInvokableClassRegistry;  Info : PTypeInfo; const InvokeOptions : TIntfInvokeOptions);
Begin Self.RegisterInvokeOptions(Info, InvokeOptions); END;

(*----------------------------------------------------------------------------*)
Procedure TInvokableClassRegistryRegisterInvokeOptions17_P(Self: TInvokableClassRegistry;  Info : PTypeInfo; const InvokeOption : TIntfInvokeOption);
Begin Self.RegisterInvokeOptions(Info, InvokeOption); END;

(*----------------------------------------------------------------------------*)
Function TInvokableClassRegistryGetUDDIInfo16_P(Self: TInvokableClassRegistry;  const AGUID : TGUID; var Operator, BindingKey : string) : Boolean;
Begin Result := Self.GetUDDIInfo(AGUID, Operator, BindingKey); END;

(*----------------------------------------------------------------------------*)
Function TInvokableClassRegistryGetUDDIInfo15_P(Self: TInvokableClassRegistry;  const IntfInfo : PTypeInfo; var Operator, BindingKey : string) : Boolean;
Begin Result := Self.GetUDDIInfo(IntfInfo, Operator, BindingKey); END;

(*----------------------------------------------------------------------------*)
Procedure TInvokableClassRegistryRegisterInvokableClass14_P(Self: TInvokableClassRegistry;  AClass : TClass);
Begin Self.RegisterInvokableClass(AClass); END;

(*----------------------------------------------------------------------------*)
Procedure TInvokableClassRegistryRegisterInvokableClass13_P(Self: TInvokableClassRegistry;  AClass : TClass; CreateProc : TCreateInstanceProc);
Begin Self.RegisterInvokableClass(AClass, CreateProc); END;

(*----------------------------------------------------------------------------*)
Function TInvokableClassRegistryGetHeaderNamespace12_P(Self: TInvokableClassRegistry;  AClass : TClass) : InvString;
Begin Result := Self.GetHeaderNamespace(AClass); END;

(*----------------------------------------------------------------------------*)
Function TInvokableClassRegistryGetHeaderNamespace11_P(Self: TInvokableClassRegistry;  Info : PTypeInfo; AClass : TClass) : InvString;
Begin Result := Self.GetHeaderNamespace(Info, AClass); END;

(*----------------------------------------------------------------------------*)
Procedure TInvokableClassRegistryRegisterHeaderMethod10_P(Self: TInvokableClassRegistry;  Info : PTypeInfo; AClass : TClass; const MethodName : string; MethodType : eHeaderMethodType; Required : Boolean);
Begin Self.RegisterHeaderMethod(Info, AClass, MethodName, MethodType, Required); END;

(*----------------------------------------------------------------------------*)
Procedure TInvokableClassRegistryRegisterHeaderClass9_P(Self: TInvokableClassRegistry;  Info : PTypeInfo; AClass : TClass; DefaultMethodType : eHeaderMethodType; Required : Boolean);
Begin Self.RegisterHeaderClass(Info, AClass, DefaultMethodType, Required); END;

(*----------------------------------------------------------------------------*)
Procedure TInvokableClassRegistryRegisterHeaderClass8_P(Self: TInvokableClassRegistry;  Info : PTypeInfo; AClass : TClass; const HeaderName : InvString; const HeaderNamespace : InvString; DefaultMethodType : eHeaderMethodType; Required : Boolean);
Begin Self.RegisterHeaderClass(Info, AClass, HeaderName, HeaderNamespace, DefaultMethodType, Required); END;

(*----------------------------------------------------------------------------*)
procedure TInvokableClassRefCount_R(Self: TInvokableClass; var T: Integer);
begin T := Self.RefCount; end;

(*----------------------------------------------------------------------------*)
Function TSOAPHeadersGet7_P(Self: TSOAPHeaders;  const Name, URI : InvString) : TSOAPHeader;
Begin Result := Self.Get(Name, URI); END;

(*----------------------------------------------------------------------------*)
Function TSOAPHeadersGet6_P(Self: TSOAPHeaders;  Cls : TClass) : TSOAPHeader;
Begin Result := Self.Get(Cls); END;

(*----------------------------------------------------------------------------*)
Procedure TSOAPHeadersGet5_P(Self: TSOAPHeaders;  Cls : TClass; out Hdr : TSOAPHeader);
Begin Self.Get(Cls, Hdr); END;

(*----------------------------------------------------------------------------*)
Function ISOAPHeadersGet4_P(Self: ISOAPHeaders;  const Name, URI : InvString) : TSOAPHeader;
Begin Result := Self.Get(Name, URI); END;

(*----------------------------------------------------------------------------*)
Function ISOAPHeadersGet3_P(Self: ISOAPHeaders;  Cls : TClass) : TSOAPHeader;
Begin Result := Self.Get(Cls); END;

(*----------------------------------------------------------------------------*)
Procedure ISOAPHeadersGet2_P(Self: ISOAPHeaders;  Cls : TClass; out Hdr : TSOAPHeader);
Begin Self.Get(Cls, Hdr); END;

(*----------------------------------------------------------------------------*)
procedure THeaderListHeaders_R(Self: THeaderList; var T: TObject; const t1: Integer);
begin T := Self.Headers[t1]; end;

(*----------------------------------------------------------------------------*)
procedure THeaderListOwnsObjects_W(Self: THeaderList; const T: Boolean);
begin Self.OwnsObjects := T; end;

(*----------------------------------------------------------------------------*)
procedure THeaderListOwnsObjects_R(Self: THeaderList; var T: Boolean);
begin T := Self.OwnsObjects; end;

(*----------------------------------------------------------------------------*)
procedure THeaderListCount_R(Self: THeaderList; var T: Integer);
begin T := Self.Count; end;

(*----------------------------------------------------------------------------*)
Procedure THeaderListAdd1_P(Self: THeaderList;  Header : TObject);
Begin Self.Add(Header); END;

(*----------------------------------------------------------------------------*)
Procedure THeaderListAdd0_P(Self: THeaderList;  Header : TSOAPHeader);
Begin Self.Add(Header); END;

(*----------------------------------------------------------------------------*)
procedure TSOAPAttachmentSourceString_W(Self: TSOAPAttachment; const T: string);
begin Self.SourceString := T; end;

(*----------------------------------------------------------------------------*)
procedure TSOAPAttachmentSourceString_R(Self: TSOAPAttachment; var T: string);
begin T := Self.SourceString; end;

(*----------------------------------------------------------------------------*)
procedure TSOAPAttachmentSourceStream_R(Self: TSOAPAttachment; var T: TStream);
begin T := Self.SourceStream; end;

(*----------------------------------------------------------------------------*)
procedure TSOAPAttachmentOwnership_W(Self: TSOAPAttachment; const T: TStreamOwnership);
begin Self.Ownership := T; end;

(*----------------------------------------------------------------------------*)
procedure TSOAPAttachmentOwnership_R(Self: TSOAPAttachment; var T: TStreamOwnership);
begin T := Self.Ownership; end;

(*----------------------------------------------------------------------------*)
procedure TSOAPAttachmentHeaders_R(Self: TSOAPAttachment; var T: TStrings);
begin T := Self.Headers; end;

(*----------------------------------------------------------------------------*)
procedure TSOAPAttachmentEncoding_W(Self: TSOAPAttachment; const T: InvString);
begin Self.Encoding := T; end;

(*----------------------------------------------------------------------------*)
procedure TSOAPAttachmentEncoding_R(Self: TSOAPAttachment; var T: InvString);
begin T := Self.Encoding; end;

(*----------------------------------------------------------------------------*)
procedure TSOAPAttachmentContentType_W(Self: TSOAPAttachment; const T: string);
begin Self.ContentType := T; end;

(*----------------------------------------------------------------------------*)
procedure TSOAPAttachmentContentType_R(Self: TSOAPAttachment; var T: string);
begin T := Self.ContentType; end;

(*----------------------------------------------------------------------------*)
procedure TSOAPAttachmentCacheFilePersist_W(Self: TSOAPAttachment; const T: Boolean);
begin Self.CacheFilePersist := T; end;

(*----------------------------------------------------------------------------*)
procedure TSOAPAttachmentCacheFilePersist_R(Self: TSOAPAttachment; var T: Boolean);
begin T := Self.CacheFilePersist; end;

(*----------------------------------------------------------------------------*)
procedure TSOAPAttachmentCacheFile_R(Self: TSOAPAttachment; var T: string);
begin T := Self.CacheFile; end;

(*----------------------------------------------------------------------------*)
procedure TSOAPHeaderActor_W(Self: TSOAPHeader; const T: InvString);
begin Self.Actor := T; end;

(*----------------------------------------------------------------------------*)
procedure TSOAPHeaderActor_R(Self: TSOAPHeader; var T: InvString);
begin T := Self.Actor; end;

(*----------------------------------------------------------------------------*)
procedure TSOAPHeaderMustUnderstand_W(Self: TSOAPHeader; const T: Boolean);
begin Self.MustUnderstand := T; end;

(*----------------------------------------------------------------------------*)
procedure TSOAPHeaderMustUnderstand_R(Self: TSOAPHeader; var T: Boolean);
begin T := Self.MustUnderstand; end;

(*----------------------------------------------------------------------------*)
procedure TRemotableSerializationOptions_R(Self: TRemotable; var T: TSerializationOptions);
begin T := Self.SerializationOptions; end;

(*----------------------------------------------------------------------------*)
procedure TRemotableDataContext_W(Self: TRemotable; const T: TDataContext);
begin Self.DataContext := T; end;

(*----------------------------------------------------------------------------*)
procedure TRemotableDataContext_R(Self: TRemotable; var T: TDataContext);
begin T := Self.DataContext; end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_InvokeRegistry_Routines(S: TPSExec);
begin
 S.RegisterDelphiFunction(@GetRemotableDataContext, 'GetRemotableDataContext', cdRegister);
 S.RegisterDelphiFunction(@SetRemotableDataContext, 'SetRemotableDataContext', cdRegister);
 S.RegisterDelphiFunction(@InvRegistry, 'InvRegistry', cdRegister);
 S.RegisterDelphiFunction(@RemClassRegistry, 'RemClassRegistry', cdRegister);
 S.RegisterDelphiFunction(@RemTypeRegistry, 'RemTypeRegistry', cdRegister);
 S.RegisterDelphiFunction(@SubstituteStrings, 'SubstituteStrings', cdRegister);
 S.RegisterDelphiFunction(@SubstituteStrings, 'SubstituteStrings', cdRegister);
end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_TInvContext(CL: TPSRuntimeClassImporter);
begin
  with CL.Add(TInvContext) do
  begin
    RegisterMethod(@TInvContext.SetMethodInfo, 'SetMethodInfo');
    RegisterMethod(@TInvContext.SetParamPointer, 'SetParamPointer');
    RegisterMethod(@TInvContext.GetParamPointer, 'GetParamPointer');
    RegisterMethod(@TInvContext.GetResultPointer, 'GetResultPointer');
    RegisterMethod(@TInvContext.SetResultPointer, 'SetResultPointer');
    RegisterMethod(@TInvContext.AllocServerData, 'AllocServerData');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_TDataContext(CL: TPSRuntimeClassImporter);
begin
  with CL.Add(TDataContext) do
  begin
    RegisterConstructor(@TDataContext.Create, 'Create');
    RegisterMethod(@TDataContext.AllocData, 'AllocData');
    RegisterMethod(@TDataContext.SetDataPointer, 'SetDataPointer');
    RegisterMethod(@TDataContext.GetDataPointer, 'GetDataPointer');
    RegisterMethod(@TDataContext.AddObjectToDestroy, 'AddObjectToDestroy');
    RegisterMethod(@TDataContext.RemoveObjectToDestroy, 'RemoveObjectToDestroy');
    RegisterMethod(@TDataContext.AddDynArrayToClear, 'AddDynArrayToClear');
    RegisterMethod(@TDataContext.AddVariantToClear, 'AddVariantToClear');
    RegisterMethod(@TDataContext.AddStrToClear, 'AddStrToClear');
    RegisterMethod(@TDataContext.AddWStrToClear, 'AddWStrToClear');
    RegisterMethod(@TDataContext.AddUStrToClear, 'AddUStrToClear');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_TRemotableTypeRegistry(CL: TPSRuntimeClassImporter);
begin
  with CL.Add(TRemotableTypeRegistry) do
  begin
    RegisterConstructor(@TRemotableTypeRegistry.Create, 'Create');
    RegisterMethod(@TRemotableTypeRegistry.RegisterXSClass, 'RegisterXSClass');
    RegisterMethod(@TRemotableTypeRegistry.RegisterXSInfo, 'RegisterXSInfo');
    RegisterMethod(@TRemotableTypeRegistry.RegisterHolderClsMember, 'RegisterHolderClsMember');
    RegisterMethod(@TRemotableTypeRegistryClassToURI27_P, 'ClassToURI27');
    RegisterMethod(@TRemotableTypeRegistryClassToURI28_P, 'ClassToURI28');
    RegisterMethod(@TRemotableTypeRegistry.InfoToURI, 'InfoToURI');
    RegisterMethod(@TRemotableTypeRegistry.TypeInfoToXSD, 'TypeInfoToXSD');
    RegisterMethod(@TRemotableTypeRegistry.GetXSDInfoForClass, 'GetXSDInfoForClass');
    RegisterMethod(@TRemotableTypeRegistryURIToClass29_P, 'URIToClass29');
    RegisterMethod(@TRemotableTypeRegistryURIToClass30_P, 'URIToClass30');
    RegisterMethod(@TRemotableTypeRegistry.XSDToTypeInfo, 'XSDToTypeInfo');
    RegisterMethod(@TRemotableTypeRegistry.URIToInfo, 'URIToInfo');
    RegisterMethod(@TRemotableTypeRegistry.GetURICount, 'GetURICount');
    RegisterMethod(@TRemotableTypeRegistryGetURIMap31_P, 'GetURIMap31');
    RegisterMethod(@TRemotableTypeRegistryGetURIMap32_P, 'GetURIMap32');
    RegisterMethod(@TRemotableTypeRegistry.IsClassScalar, 'IsClassScalar');
    RegisterMethod(@TRemotableTypeRegistry.ClassOptions, 'ClassOptions');
    RegisterMethod(@TRemotableTypeRegistry.VariantToInfo, 'VariantToInfo');
    RegisterMethod(@TRemotableTypeRegistry.GetVarTypeFromXSD, 'GetVarTypeFromXSD');
    RegisterMethod(@TRemotableTypeRegistryRegisterSerializeOptions33_P, 'RegisterSerializeOptions33');
    RegisterMethod(@TRemotableTypeRegistrySerializeOptions34_P, 'SerializeOptions34');
    RegisterMethod(@TRemotableTypeRegistryRegisterSerializeOptions35_P, 'RegisterSerializeOptions35');
    RegisterMethod(@TRemotableTypeRegistrySerializeOptions36_P, 'SerializeOptions36');
    RegisterMethod(@TRemotableTypeRegistry.UnRegisterXSClass, 'UnRegisterXSClass');
    RegisterMethod(@TRemotableTypeRegistry.UnRegisterXSInfo, 'UnRegisterXSInfo');
    RegisterMethod(@TRemotableTypeRegistry.RegisterExternalPropName, 'RegisterExternalPropName');
    RegisterMethod(@TRemotableTypeRegistry.GetExternalPropName, 'GetExternalPropName');
    RegisterMethod(@TRemotableTypeRegistry.GetInternalPropName, 'GetInternalPropName');
    RegisterPropertyHelper(@TRemotableTypeRegistryAutoRegisterNativeTypes_R,@TRemotableTypeRegistryAutoRegisterNativeTypes_W,'AutoRegisterNativeTypes');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_TInvokableClassRegistry(CL: TPSRuntimeClassImporter);
begin
  with CL.Add(TInvokableClassRegistry) do
  begin
    RegisterConstructor(@TInvokableClassRegistry.Create, 'Create');
    RegisterMethod(@TInvokableClassRegistry.RegisterInterface, 'RegisterInterface');
    RegisterMethod(@TInvokableClassRegistryRegisterHeaderClass8_P, 'RegisterHeaderClass8');
    RegisterMethod(@TInvokableClassRegistryRegisterHeaderClass9_P, 'RegisterHeaderClass9');
    RegisterMethod(@TInvokableClassRegistryRegisterHeaderMethod10_P, 'RegisterHeaderMethod10');
    RegisterMethod(@TInvokableClassRegistry.GetHeaderInfoForInterface, 'GetHeaderInfoForInterface');
    RegisterMethod(@TInvokableClassRegistry.GetRequestHeaderInfoForInterface, 'GetRequestHeaderInfoForInterface');
    RegisterMethod(@TInvokableClassRegistry.GetResponseHeaderInfoForInterface, 'GetResponseHeaderInfoForInterface');
    RegisterMethod(@TInvokableClassRegistry.GetHeaderName, 'GetHeaderName');
    RegisterMethod(@TInvokableClassRegistryGetHeaderNamespace11_P, 'GetHeaderNamespace11');
    RegisterMethod(@TInvokableClassRegistryGetHeaderNamespace12_P, 'GetHeaderNamespace12');
    RegisterMethod(@TInvokableClassRegistry.GetHeaderClass, 'GetHeaderClass');
    RegisterMethod(@TInvokableClassRegistry.RegisterException, 'RegisterException');
    RegisterMethod(@TInvokableClassRegistry.RegisterExceptionMethod, 'RegisterExceptionMethod');
    RegisterMethod(@TInvokableClassRegistry.GetExceptionInfoForInterface, 'GetExceptionInfoForInterface');
    RegisterMethod(@TInvokableClassRegistryRegisterInvokableClass13_P, 'RegisterInvokableClass13');
    RegisterMethod(@TInvokableClassRegistryRegisterInvokableClass14_P, 'RegisterInvokableClass14');
    RegisterMethod(@TInvokableClassRegistry.RegisterExternalParamName, 'RegisterExternalParamName');
    RegisterMethod(@TInvokableClassRegistry.RegisterParamInfo, 'RegisterParamInfo');
    RegisterMethod(@TInvokableClassRegistry.GetParamInfo, 'GetParamInfo');
    RegisterMethod(@TInvokableClassRegistry.RegisterExternalMethName, 'RegisterExternalMethName');
    RegisterMethod(@TInvokableClassRegistry.RegisterMethodInfo, 'RegisterMethodInfo');
    RegisterMethod(@TInvokableClassRegistry.GetMethodInfo, 'GetMethodInfo');
    RegisterMethod(@TInvokableClassRegistry.RegisterDefaultSOAPAction, 'RegisterDefaultSOAPAction');
    RegisterMethod(@TInvokableClassRegistry.RegisterAllSOAPActions, 'RegisterAllSOAPActions');
    RegisterMethod(@TInvokableClassRegistry.GetActionURIOfInfo, 'GetActionURIOfInfo');
    RegisterMethod(@TInvokableClassRegistry.GetActionURIOfIID, 'GetActionURIOfIID');
    RegisterMethod(@TInvokableClassRegistry.RegisterUDDIInfo, 'RegisterUDDIInfo');
    RegisterMethod(@TInvokableClassRegistryGetUDDIInfo15_P, 'GetUDDIInfo15');
    RegisterMethod(@TInvokableClassRegistryGetUDDIInfo16_P, 'GetUDDIInfo16');
    RegisterMethod(@TInvokableClassRegistry.RegisterReturnParamNames, 'RegisterReturnParamNames');
    RegisterMethod(@TInvokableClassRegistry.GetReturnParamNames, 'GetReturnParamNames');
    RegisterMethod(@TInvokableClassRegistryRegisterInvokeOptions17_P, 'RegisterInvokeOptions17');
    RegisterMethod(@TInvokableClassRegistryRegisterInvokeOptions18_P, 'RegisterInvokeOptions18');
    RegisterMethod(@TInvokableClassRegistry.GetNamespaceByGUID, 'GetNamespaceByGUID');
    RegisterMethod(@TInvokableClassRegistry.GetInfoForURI, 'GetInfoForURI');
    RegisterMethod(@TInvokableClassRegistryGetIntfInvokeOptions19_P, 'GetIntfInvokeOptions19');
    RegisterMethod(@TInvokableClassRegistryGetIntfInvokeOptions20_P, 'GetIntfInvokeOptions20');
    RegisterMethod(@TInvokableClassRegistry.GetInterfaceInfoFromName, 'GetInterfaceInfoFromName');
    RegisterMethod(@TInvokableClassRegistry.GetInterfaceTypeInfo, 'GetInterfaceTypeInfo');
    RegisterMethod(@TInvokableClassRegistry.GetInvokableObjectFromClass, 'GetInvokableObjectFromClass');
    RegisterMethod(@TInvokableClassRegistry.GetRegInterfaceEntry, 'GetRegInterfaceEntry');
    RegisterMethod(@TInvokableClassRegistry.HasRegInterfaceImpl, 'HasRegInterfaceImpl');
    RegisterMethod(@TInvokableClassRegistry.GetClassFromIntfInfo, 'GetClassFromIntfInfo');
    RegisterMethod(@TInvokableClassRegistry.GetInterfaceCount, 'GetInterfaceCount');
    RegisterMethod(@TInvokableClassRegistryGetInterfaceExternalName21_P, 'GetInterfaceExternalName21');
    RegisterMethod(@TInvokableClassRegistryGetInterfaceExternalName22_P, 'GetInterfaceExternalName22');
    RegisterMethod(@TInvokableClassRegistryGetInterfaceExternalName23_P, 'GetInterfaceExternalName23');
    RegisterMethod(@TInvokableClassRegistryGetWSDLEncoding24_P, 'GetWSDLEncoding24');
    RegisterMethod(@TInvokableClassRegistryGetWSDLEncoding25_P, 'GetWSDLEncoding25');
    RegisterMethod(@TInvokableClassRegistryGetWSDLEncoding26_P, 'GetWSDLEncoding26');
    RegisterMethod(@TInvokableClassRegistry.UnRegisterInterface, 'UnRegisterInterface');
    RegisterMethod(@TInvokableClassRegistry.UnRegisterInvokableClass, 'UnRegisterInvokableClass');
    RegisterMethod(@TInvokableClassRegistry.GetParamExternalName, 'GetParamExternalName');
    RegisterMethod(@TInvokableClassRegistry.GetParamInternalName, 'GetParamInternalName');
    RegisterMethod(@TInvokableClassRegistry.GetMethExternalName, 'GetMethExternalName');
    RegisterMethod(@TInvokableClassRegistry.GetMethInternalName, 'GetMethInternalName');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_TInvokableClass(CL: TPSRuntimeClassImporter);
begin
  with CL.Add(TInvokableClass) do
  begin
    RegisterVirtualConstructor(@TInvokableClass.Create, 'Create');
    RegisterPropertyHelper(@TInvokableClassRefCount_R,nil,'RefCount');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_TSOAPHeaders(CL: TPSRuntimeClassImporter);
begin
  with CL.Add(TSOAPHeaders) do
  begin
    RegisterMethod(@TSOAPHeaders.Send, 'Send');
    RegisterMethod(@TSOAPHeaders.SendCount, 'SendCount');
    RegisterMethod(@TSOAPHeaders.SendAt, 'SendAt');
    RegisterMethod(@TSOAPHeadersGet5_P, 'Get5');
    RegisterMethod(@TSOAPHeadersGet6_P, 'Get6');
    RegisterMethod(@TSOAPHeadersGet7_P, 'Get7');
    RegisterMethod(@TSOAPHeaders.GetOwnsSentHeaders, 'GetOwnsSentHeaders');
    RegisterMethod(@TSOAPHeaders.SetOwnsSentHeaders, 'SetOwnsSentHeaders');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_TSOAPHeadersBase(CL: TPSRuntimeClassImporter);
begin
  with CL.Add(TSOAPHeadersBase) do
  begin
  end;
end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_THeaderList(CL: TPSRuntimeClassImporter);
begin
  with CL.Add(THeaderList) do
  begin
    RegisterConstructor(@THeaderList.Create, 'Create');
    RegisterMethod(@THeaderListAdd0_P, 'Add0');
    RegisterMethod(@THeaderListAdd1_P, 'Add1');
    RegisterMethod(@THeaderList.Clear, 'Clear');
    RegisterMethod(@THeaderList.Extract, 'Extract');
    RegisterMethod(@THeaderList.IndexOf, 'IndexOf');
    RegisterPropertyHelper(@THeaderListCount_R,nil,'Count');
    RegisterPropertyHelper(@THeaderListOwnsObjects_R,@THeaderListOwnsObjects_W,'OwnsObjects');
    RegisterPropertyHelper(@THeaderListHeaders_R,nil,'Headers');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_TSOAPAttachment(CL: TPSRuntimeClassImporter);
begin
  with CL.Add(TSOAPAttachment) do
  begin
    RegisterMethod(@TSOAPAttachment.Init, 'Init');
    RegisterPropertyHelper(@TSOAPAttachmentCacheFile_R,nil,'CacheFile');
    RegisterPropertyHelper(@TSOAPAttachmentCacheFilePersist_R,@TSOAPAttachmentCacheFilePersist_W,'CacheFilePersist');
    RegisterPropertyHelper(@TSOAPAttachmentContentType_R,@TSOAPAttachmentContentType_W,'ContentType');
    RegisterPropertyHelper(@TSOAPAttachmentEncoding_R,@TSOAPAttachmentEncoding_W,'Encoding');
    RegisterPropertyHelper(@TSOAPAttachmentHeaders_R,nil,'Headers');
    RegisterPropertyHelper(@TSOAPAttachmentOwnership_R,@TSOAPAttachmentOwnership_W,'Ownership');
    RegisterPropertyHelper(@TSOAPAttachmentSourceStream_R,nil,'SourceStream');
    RegisterPropertyHelper(@TSOAPAttachmentSourceString_R,@TSOAPAttachmentSourceString_W,'SourceString');
    RegisterMethod(@TSOAPAttachment.SaveToStream, 'SaveToStream');
    RegisterMethod(@TSOAPAttachment.SaveToFile, 'SaveToFile');
    RegisterVirtualMethod(@TSOAPAttachment.SetSourceFile, 'SetSourceFile');
    RegisterVirtualMethod(@TSOAPAttachment.SetSourceStream, 'SetSourceStream');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_TSOAPHeader(CL: TPSRuntimeClassImporter);
begin
  with CL.Add(TSOAPHeader) do
  begin
    RegisterPropertyHelper(@TSOAPHeaderMustUnderstand_R,@TSOAPHeaderMustUnderstand_W,'MustUnderstand');
    RegisterPropertyHelper(@TSOAPHeaderActor_R,@TSOAPHeaderActor_W,'Actor');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_TRemotableXS(CL: TPSRuntimeClassImporter);
begin
  with CL.Add(TRemotableXS) do
  begin
    RegisterVirtualAbstractMethod(@TRemotableXS, @!.NativeToXS, 'NativeToXS');
    RegisterVirtualAbstractMethod(@TRemotableXS, @!.XSToNative, 'XSToNative');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_TRemotable(CL: TPSRuntimeClassImporter);
begin
  with CL.Add(TRemotable) do
  begin
    RegisterVirtualConstructor(@TRemotable.Create, 'Create');
    RegisterVirtualMethod(@TRemotable.ObjectToSOAP, 'ObjectToSOAP');
    RegisterVirtualMethod(@TRemotable.SOAPToObject, 'SOAPToObject');
    RegisterPropertyHelper(@TRemotableDataContext_R,@TRemotableDataContext_W,'DataContext');
    RegisterPropertyHelper(@TRemotableSerializationOptions_R,nil,'SerializationOptions');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_InvokeRegistry(CL: TPSRuntimeClassImporter);
begin
  with CL.Add(TDataContext) do
  with CL.Add(TSOAPAttachment) do
  RIRegister_TRemotable(CL);
  RIRegister_TRemotableXS(CL);
  RIRegister_TSOAPHeader(CL);
  RIRegister_TSOAPAttachment(CL);
  RIRegister_THeaderList(CL);
  RIRegister_TSOAPHeadersBase(CL);
  RIRegister_TSOAPHeaders(CL);
  RIRegister_TInvokableClass(CL);
  RIRegister_TInvokableClassRegistry(CL);
  with CL.Add(ETypeRegistryException) do
  RIRegister_TRemotableTypeRegistry(CL);
  RIRegister_TDataContext(CL);
  RIRegister_TInvContext(CL);
end;

 
 
{ TPSImport_InvokeRegistry }
(*----------------------------------------------------------------------------*)
procedure TPSImport_InvokeRegistry.CompileImport1(CompExec: TPSScript);
begin
  SIRegister_InvokeRegistry(CompExec.Comp);
end;
(*----------------------------------------------------------------------------*)
procedure TPSImport_InvokeRegistry.ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter);
begin
  RIRegister_InvokeRegistry(ri);
  RIRegister_InvokeRegistry_Routines(CompExec.Exec); // comment it if no routines
end;
(*----------------------------------------------------------------------------*)
 
 
end.
