unit FactuGES_Intf;

{----------------------------------------------------------------------------}
{ This unit was automatically generated by the RemObjects SDK after reading  }
{ the RODL file associated with this project .                               }
{                                                                            }
{ Do not modify this unit manually, or your changes will be lost when this   }
{ unit is regenerated the next time you compile the project.                 }
{----------------------------------------------------------------------------}

interface

uses
  {vcl:} Classes, TypInfo,
  {RemObjects:} uROClasses, uROClient, uROTypes, uROClientIntf,
  {Used RODLs:} DataAbstract_Intf;

const
  { Library ID }
  LibraryUID = '{99553DD5-13B5-40EB-B7E6-D2B9A7C1B4D6}';

  { Service Interface ID's }
  IsrvContactos_IID : TGUID = '{28CCDC07-A3A4-4917-89B4-64423DC70C9D}';
  IsrvLogin_IID : TGUID = '{399F9DB4-1B34-4140-AB6E-3BC10C0A7034}';
  IsrvPresupuestos_IID : TGUID = '{19455BFF-0767-45E9-A385-627A61A35BB8}';
  IsrvEmpresas_IID : TGUID = '{590F06D1-26B4-435B-B636-50CB8FFE6353}';
  IsrvFacturasCliente_IID : TGUID = '{56B4FFF0-AB1B-46B2-BA16-ABD5360F6311}';
  IsrvPedidosProveedor_IID : TGUID = '{3DCC03E4-E9CE-4798-99D4-7170C9CF815B}';
  IsrvCobrosCliente_IID : TGUID = '{011FDB20-A59A-462C-AF24-0E86ABB5EE53}';
  IsrvConfiguracion_IID : TGUID = '{0882B8A4-C8AA-424E-8FC1-C6226B670522}';
  IsrvMontajes_IID : TGUID = '{DDDB5F75-48F8-4EDC-981F-2BAF5A975C9D}';

  { Event ID's }

type
  { Forward declarations }
  IsrvContactos = interface;
  IsrvLogin = interface;
  IsrvPresupuestos = interface;
  IsrvEmpresas = interface;
  IsrvFacturasCliente = interface;
  IsrvPedidosProveedor = interface;
  IsrvCobrosCliente = interface;
  IsrvConfiguracion = interface;
  IsrvMontajes = interface;

  TRdxEmpresasArray = class;

  TRdxLoginInfo = class;


  { TRdxLoginInfo }
  TRdxLoginInfo = class(TROComplexType)
  private
    fUserID: Integer;
    fSessionID: String;
    fUsuario: String;
    fPerfiles: TDAStringArray;
    fEmpresas: TRdxEmpresasArray;
    function GetPerfiles: TDAStringArray;
    function GetEmpresas: TRdxEmpresasArray;
  public
    procedure Assign(iSource: TPersistent); override;
  published
    property UserID:Integer read fUserID write fUserID;
    property SessionID:String read fSessionID write fSessionID;
    property Usuario:String read fUsuario write fUsuario;
    property Perfiles:TDAStringArray read GetPerfiles write fPerfiles;
    property Empresas:TRdxEmpresasArray read GetEmpresas write fEmpresas;
  end;

  { TRdxLoginInfoCollection }
  TRdxLoginInfoCollection = class(TROCollection)
  protected
    constructor Create(aItemClass: TCollectionItemClass); overload;
    function GetItems(Index: integer): TRdxLoginInfo;
    procedure SetItems(Index: integer; const Value: TRdxLoginInfo);
  public
    constructor Create; overload;
    function Add: TRdxLoginInfo; reintroduce;
    property Items[Index: integer]:TRdxLoginInfo read GetItems write SetItems; default;
  end;

  { TRdxEmpresasArray }
  TRdxEmpresasArray = class(TROArray)
  private
    fCount: Integer;
    fItems : array of Integer;
  protected
    procedure Grow; virtual;
    function GetItems(Index: integer): Integer;
    procedure SetItems(Index: integer; const Value: Integer);
    function GetCount: integer; override;
  public
    class function GetItemType: PTypeInfo; override;
    class function GetItemSize: integer; override;
    function GetItemRef(Index: integer): pointer; override;
    procedure Clear; override;
    procedure Delete(Index: integer); override;
    procedure Resize(ElementCount: integer); override;

    procedure Assign(iSource:TPersistent); override;
    function Add(const Value:Integer): integer;

    property Count : integer read GetCount;
    property Items[Index: integer]:Integer read GetItems write SetItems; default;
  end;

  { IsrvContactos }
  IsrvContactos = interface(IDARemoteService)
    ['{28CCDC07-A3A4-4917-89B4-64423DC70C9D}']
    function GetNextAutoInc(const GeneratorName: String): Integer;
  end;

  { CosrvContactos }
  CosrvContactos = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvContactos;
  end;

  { TsrvContactos_Proxy }
  TsrvContactos_Proxy = class(TDARemoteService_Proxy, IsrvContactos)
  protected
    function __GetInterfaceName:string; override;

    function GetNextAutoInc(const GeneratorName: String): Integer;
  end;

  { IsrvLogin }
  IsrvLogin = interface(IDARemoteService)
    ['{399F9DB4-1B34-4140-AB6E-3BC10C0A7034}']
    function Login(const User: String; const Password: String; out LoginInfo: TRdxLoginInfo): Boolean;
    procedure Logout;
    function Ping: Boolean;
  end;

  { CosrvLogin }
  CosrvLogin = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvLogin;
  end;

  { TsrvLogin_Proxy }
  TsrvLogin_Proxy = class(TDARemoteService_Proxy, IsrvLogin)
  protected
    function __GetInterfaceName:string; override;

    function Login(const User: String; const Password: String; out LoginInfo: TRdxLoginInfo): Boolean;
    procedure Logout;
    function Ping: Boolean;
  end;

  { IsrvPresupuestos }
  IsrvPresupuestos = interface(IDARemoteService)
    ['{19455BFF-0767-45E9-A385-627A61A35BB8}']
    function GetNextAutoInc(const GeneratorName: String): Integer;
    function GenerateReport(const ID: Integer): Binary;
  end;

  { CosrvPresupuestos }
  CosrvPresupuestos = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvPresupuestos;
  end;

  { TsrvPresupuestos_Proxy }
  TsrvPresupuestos_Proxy = class(TDARemoteService_Proxy, IsrvPresupuestos)
  protected
    function __GetInterfaceName:string; override;

    function GetNextAutoInc(const GeneratorName: String): Integer;
    function GenerateReport(const ID: Integer): Binary;
  end;

  { IsrvEmpresas }
  IsrvEmpresas = interface(IDARemoteService)
    ['{590F06D1-26B4-435B-B636-50CB8FFE6353}']
    function GetNextAutoInc(const GeneratorName: String): Integer;
  end;

  { CosrvEmpresas }
  CosrvEmpresas = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvEmpresas;
  end;

  { TsrvEmpresas_Proxy }
  TsrvEmpresas_Proxy = class(TDARemoteService_Proxy, IsrvEmpresas)
  protected
    function __GetInterfaceName:string; override;

    function GetNextAutoInc(const GeneratorName: String): Integer;
  end;

  { IsrvFacturasCliente }
  IsrvFacturasCliente = interface(IDARemoteService)
    ['{56B4FFF0-AB1B-46B2-BA16-ABD5360F6311}']
    function GetNextAutoInc(const GeneratorName: String): Integer;
    function GenerateReport(const FacturaID: Integer): Binary;
  end;

  { CosrvFacturasCliente }
  CosrvFacturasCliente = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvFacturasCliente;
  end;

  { TsrvFacturasCliente_Proxy }
  TsrvFacturasCliente_Proxy = class(TDARemoteService_Proxy, IsrvFacturasCliente)
  protected
    function __GetInterfaceName:string; override;

    function GetNextAutoInc(const GeneratorName: String): Integer;
    function GenerateReport(const FacturaID: Integer): Binary;
  end;

  { IsrvPedidosProveedor }
  IsrvPedidosProveedor = interface(IDARemoteService)
    ['{3DCC03E4-E9CE-4798-99D4-7170C9CF815B}']
    function GetNextAutoInc(const GeneratorName: String): Integer;
    function GenerateReport(const ID: Integer): Binary;
  end;

  { CosrvPedidosProveedor }
  CosrvPedidosProveedor = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvPedidosProveedor;
  end;

  { TsrvPedidosProveedor_Proxy }
  TsrvPedidosProveedor_Proxy = class(TDARemoteService_Proxy, IsrvPedidosProveedor)
  protected
    function __GetInterfaceName:string; override;

    function GetNextAutoInc(const GeneratorName: String): Integer;
    function GenerateReport(const ID: Integer): Binary;
  end;

  { IsrvCobrosCliente }
  IsrvCobrosCliente = interface(IDARemoteService)
    ['{011FDB20-A59A-462C-AF24-0E86ABB5EE53}']
    function GetNextAutoInc(const GeneratorName: String): Integer;
    function GenerateReport(const CobroID: Integer): Binary;
  end;

  { CosrvCobrosCliente }
  CosrvCobrosCliente = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvCobrosCliente;
  end;

  { TsrvCobrosCliente_Proxy }
  TsrvCobrosCliente_Proxy = class(TDARemoteService_Proxy, IsrvCobrosCliente)
  protected
    function __GetInterfaceName:string; override;

    function GetNextAutoInc(const GeneratorName: String): Integer;
    function GenerateReport(const CobroID: Integer): Binary;
  end;

  { IsrvConfiguracion }
  IsrvConfiguracion = interface(IDARemoteService)
    ['{0882B8A4-C8AA-424E-8FC1-C6226B670522}']
    function darValor(const CODIGO: String): String;
  end;

  { CosrvConfiguracion }
  CosrvConfiguracion = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvConfiguracion;
  end;

  { TsrvConfiguracion_Proxy }
  TsrvConfiguracion_Proxy = class(TDARemoteService_Proxy, IsrvConfiguracion)
  protected
    function __GetInterfaceName:string; override;

    function darValor(const CODIGO: String): String;
  end;

  { IsrvMontajes }
  IsrvMontajes = interface(IDARemoteService)
    ['{DDDB5F75-48F8-4EDC-981F-2BAF5A975C9D}']
    function GetNextAutoInc(const GeneratorName: String): Integer;
  end;

  { CosrvMontajes }
  CosrvMontajes = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvMontajes;
  end;

  { TsrvMontajes_Proxy }
  TsrvMontajes_Proxy = class(TDARemoteService_Proxy, IsrvMontajes)
  protected
    function __GetInterfaceName:string; override;

    function GetNextAutoInc(const GeneratorName: String): Integer;
  end;

implementation

uses
  {vcl:} SysUtils,
  {RemObjects:} uROEventRepository, uRORes;

{ TRdxEmpresasArray }

procedure TRdxEmpresasArray.Assign(iSource: TPersistent);
var lSource:TRdxEmpresasArray;
    i:integer;
begin
  if (iSource is TRdxEmpresasArray) then begin
    lSource := TRdxEmpresasArray(iSource);
    Clear();
    Resize(lSource.Count);
    for i := 0 to Count-1 do begin
      Items[i] := lSource.Items[i];
    end;
  end
  else begin
    inherited Assign(iSource);
  end;
end;

class function TRdxEmpresasArray.GetItemType: PTypeInfo;
begin
  result := TypeInfo(Integer);
end;

class function TRdxEmpresasArray.GetItemSize: integer;
begin
  result := SizeOf(Integer);
end;

function TRdxEmpresasArray.GetItems(Index: integer): Integer;
begin
  if (Index < 0) or (Index >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[Index]);
  result := fItems[Index];
end;

function TRdxEmpresasArray.GetItemRef(Index: integer): pointer;
begin
  if (Index < 0) or (Index >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[Index]);
  result := @fItems[Index];
end;

procedure TRdxEmpresasArray.Clear;
begin
  SetLength(fItems, 0);
  FCount := 0;
end;

procedure TRdxEmpresasArray.Delete(Index: integer);
var i: integer;
begin
  if (Index>=Count) then RaiseError(err_InvalidIndex, [Index]);

  if (Index<Count-1) then
    for i := Index to Count-2 do fItems[i] := fItems[i+1];

  SetLength(fItems, Count-1);
  Dec(FCount);
end;

procedure TRdxEmpresasArray.SetItems(Index: integer; const Value: Integer);
begin
  if (Index < 0) or (Index >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[Index]);
  fItems[Index] := Value;
end;

procedure TRdxEmpresasArray.Resize(ElementCount: integer);
begin
  SetLength(fItems, ElementCount);
  FCount := ElementCount;
end;

function TRdxEmpresasArray.GetCount: integer;
begin
  result := FCount;
end;

procedure TRdxEmpresasArray.Grow;
var
  Delta, Capacity: Integer;
begin
  Capacity := Length(fItems);
  if Capacity > 64 then
    Delta := Capacity div 4
  else
    if Capacity > 8 then
      Delta := 16
   else
      Delta := 4;
  SetLength(fItems, Capacity + Delta);
end;

function TRdxEmpresasArray.Add(const Value: Integer): integer;
begin
  Result := Count;
  if Length(fItems) = Result then
    Grow;
  fItems[result] := Value;
  Inc(fCount);
end;

{ TRdxLoginInfo }

procedure TRdxLoginInfo.Assign(iSource: TPersistent); 
var lSource:TRdxLoginInfo;
begin
  inherited Assign(iSource);
  if (iSource is TRdxLoginInfo) then begin
    lSource := TRdxLoginInfo(iSource);
    UserID := lSource.UserID;
    SessionID := lSource.SessionID;
    Usuario := lSource.Usuario;
    Perfiles.Assign(lSource.Perfiles);
    Empresas.Assign(lSource.Empresas);
  end;
end;

function TRdxLoginInfo.GetPerfiles: TDAStringArray;
begin
  if (fPerfiles = nil) then fPerfiles := TDAStringArray.Create();
  result := fPerfiles;
end;

function TRdxLoginInfo.GetEmpresas: TRdxEmpresasArray;
begin
  if (fEmpresas = nil) then fEmpresas := TRdxEmpresasArray.Create();
  result := fEmpresas;
end;

{ TRdxLoginInfoCollection }
constructor TRdxLoginInfoCollection.Create;
begin
  inherited Create(TRdxLoginInfo);
end;

constructor TRdxLoginInfoCollection.Create(aItemClass: TCollectionItemClass);
begin
  inherited Create(aItemClass);
end;

function TRdxLoginInfoCollection.Add: TRdxLoginInfo;
begin
  result := TRdxLoginInfo(inherited Add);
end;

function TRdxLoginInfoCollection.GetItems(Index: integer): TRdxLoginInfo;
begin
  result := TRdxLoginInfo(inherited Items[Index]);
end;

procedure TRdxLoginInfoCollection.SetItems(Index: integer; const Value: TRdxLoginInfo);
begin
  TRdxLoginInfo(inherited Items[Index]).Assign(Value);
end;

{ CosrvContactos }

class function CosrvContactos.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvContactos;
begin
  result := TsrvContactos_Proxy.Create(aMessage, aTransportChannel);
end;

{ TsrvContactos_Proxy }

function TsrvContactos_Proxy.__GetInterfaceName:string;
begin
  result := 'srvContactos';
end;

function TsrvContactos_Proxy.GetNextAutoInc(const GeneratorName: String): Integer;
var
  __request, __response : TMemoryStream;
begin
  __request := TMemoryStream.Create;
  __response := TMemoryStream.Create;

  try
     __Message.Initialize(__TransportChannel, 'FactuGES', __InterfaceName, 'GetNextAutoInc');
     __Message.Write('GeneratorName', TypeInfo(String), GeneratorName, []);
     __Message.Finalize;

     __Message.WriteToStream(__request);
     __TransportChannel.Dispatch(__request, __response);
     __Message.ReadFromStream(__response);

     __Message.Read('Result', TypeInfo(Integer), result, []);
  finally
    __request.Free;
    __response.Free;
  end
end;

{ CosrvLogin }

class function CosrvLogin.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvLogin;
begin
  result := TsrvLogin_Proxy.Create(aMessage, aTransportChannel);
end;

{ TsrvLogin_Proxy }

function TsrvLogin_Proxy.__GetInterfaceName:string;
begin
  result := 'srvLogin';
end;

function TsrvLogin_Proxy.Login(const User: String; const Password: String; out LoginInfo: TRdxLoginInfo): Boolean;
var
  __request, __response : TMemoryStream;
begin
  LoginInfo := nil;
  __request := TMemoryStream.Create;
  __response := TMemoryStream.Create;

  try
     __Message.Initialize(__TransportChannel, 'FactuGES', __InterfaceName, 'Login');
     __Message.Write('User', TypeInfo(String), User, []);
     __Message.Write('Password', TypeInfo(String), Password, []);
     __Message.Finalize;

     __Message.WriteToStream(__request);
     __TransportChannel.Dispatch(__request, __response);
     __Message.ReadFromStream(__response);

     __Message.Read('Result', TypeInfo(Boolean), result, []);
     __Message.Read('LoginInfo', TypeInfo(FactuGES_Intf.TRdxLoginInfo), LoginInfo, []);
  finally
    __request.Free;
    __response.Free;
  end
end;

procedure TsrvLogin_Proxy.Logout;
var
  __request, __response : TMemoryStream;
begin
  __request := TMemoryStream.Create;
  __response := TMemoryStream.Create;

  try
     __Message.Initialize(__TransportChannel, 'FactuGES', __InterfaceName, 'Logout');
     __Message.Finalize;

     __Message.WriteToStream(__request);
     __TransportChannel.Dispatch(__request, __response);
     __Message.ReadFromStream(__response);

  finally
    __request.Free;
    __response.Free;
  end
end;

function TsrvLogin_Proxy.Ping: Boolean;
var
  __request, __response : TMemoryStream;
begin
  __request := TMemoryStream.Create;
  __response := TMemoryStream.Create;

  try
     __Message.Initialize(__TransportChannel, 'FactuGES', __InterfaceName, 'Ping');
     __Message.Finalize;

     __Message.WriteToStream(__request);
     __TransportChannel.Dispatch(__request, __response);
     __Message.ReadFromStream(__response);

     __Message.Read('Result', TypeInfo(Boolean), result, []);
  finally
    __request.Free;
    __response.Free;
  end
end;

{ CosrvPresupuestos }

class function CosrvPresupuestos.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvPresupuestos;
begin
  result := TsrvPresupuestos_Proxy.Create(aMessage, aTransportChannel);
end;

{ TsrvPresupuestos_Proxy }

function TsrvPresupuestos_Proxy.__GetInterfaceName:string;
begin
  result := 'srvPresupuestos';
end;

function TsrvPresupuestos_Proxy.GetNextAutoInc(const GeneratorName: String): Integer;
var
  __request, __response : TMemoryStream;
begin
  __request := TMemoryStream.Create;
  __response := TMemoryStream.Create;

  try
     __Message.Initialize(__TransportChannel, 'FactuGES', __InterfaceName, 'GetNextAutoInc');
     __Message.Write('GeneratorName', TypeInfo(String), GeneratorName, []);
     __Message.Finalize;

     __Message.WriteToStream(__request);
     __TransportChannel.Dispatch(__request, __response);
     __Message.ReadFromStream(__response);

     __Message.Read('Result', TypeInfo(Integer), result, []);
  finally
    __request.Free;
    __response.Free;
  end
end;

function TsrvPresupuestos_Proxy.GenerateReport(const ID: Integer): Binary;
var
  __request, __response : TMemoryStream;
begin
  result := nil;
  __request := TMemoryStream.Create;
  __response := TMemoryStream.Create;

  try
     __Message.Initialize(__TransportChannel, 'FactuGES', __InterfaceName, 'GenerateReport');
     __Message.Write('ID', TypeInfo(Integer), ID, []);
     __Message.Finalize;

     __Message.WriteToStream(__request);
     __TransportChannel.Dispatch(__request, __response);
     __Message.ReadFromStream(__response);

     __Message.Read('Result', TypeInfo(Binary), result, []);
  finally
    __request.Free;
    __response.Free;
  end
end;

{ CosrvEmpresas }

class function CosrvEmpresas.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvEmpresas;
begin
  result := TsrvEmpresas_Proxy.Create(aMessage, aTransportChannel);
end;

{ TsrvEmpresas_Proxy }

function TsrvEmpresas_Proxy.__GetInterfaceName:string;
begin
  result := 'srvEmpresas';
end;

function TsrvEmpresas_Proxy.GetNextAutoInc(const GeneratorName: String): Integer;
var
  __request, __response : TMemoryStream;
begin
  __request := TMemoryStream.Create;
  __response := TMemoryStream.Create;

  try
     __Message.Initialize(__TransportChannel, 'FactuGES', __InterfaceName, 'GetNextAutoInc');
     __Message.Write('GeneratorName', TypeInfo(String), GeneratorName, []);
     __Message.Finalize;

     __Message.WriteToStream(__request);
     __TransportChannel.Dispatch(__request, __response);
     __Message.ReadFromStream(__response);

     __Message.Read('Result', TypeInfo(Integer), result, []);
  finally
    __request.Free;
    __response.Free;
  end
end;

{ CosrvFacturasCliente }

class function CosrvFacturasCliente.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvFacturasCliente;
begin
  result := TsrvFacturasCliente_Proxy.Create(aMessage, aTransportChannel);
end;

{ TsrvFacturasCliente_Proxy }

function TsrvFacturasCliente_Proxy.__GetInterfaceName:string;
begin
  result := 'srvFacturasCliente';
end;

function TsrvFacturasCliente_Proxy.GetNextAutoInc(const GeneratorName: String): Integer;
var
  __request, __response : TMemoryStream;
begin
  __request := TMemoryStream.Create;
  __response := TMemoryStream.Create;

  try
     __Message.Initialize(__TransportChannel, 'FactuGES', __InterfaceName, 'GetNextAutoInc');
     __Message.Write('GeneratorName', TypeInfo(String), GeneratorName, []);
     __Message.Finalize;

     __Message.WriteToStream(__request);
     __TransportChannel.Dispatch(__request, __response);
     __Message.ReadFromStream(__response);

     __Message.Read('Result', TypeInfo(Integer), result, []);
  finally
    __request.Free;
    __response.Free;
  end
end;

function TsrvFacturasCliente_Proxy.GenerateReport(const FacturaID: Integer): Binary;
var
  __request, __response : TMemoryStream;
begin
  result := nil;
  __request := TMemoryStream.Create;
  __response := TMemoryStream.Create;

  try
     __Message.Initialize(__TransportChannel, 'FactuGES', __InterfaceName, 'GenerateReport');
     __Message.Write('FacturaID', TypeInfo(Integer), FacturaID, []);
     __Message.Finalize;

     __Message.WriteToStream(__request);
     __TransportChannel.Dispatch(__request, __response);
     __Message.ReadFromStream(__response);

     __Message.Read('Result', TypeInfo(Binary), result, []);
  finally
    __request.Free;
    __response.Free;
  end
end;

{ CosrvPedidosProveedor }

class function CosrvPedidosProveedor.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvPedidosProveedor;
begin
  result := TsrvPedidosProveedor_Proxy.Create(aMessage, aTransportChannel);
end;

{ TsrvPedidosProveedor_Proxy }

function TsrvPedidosProveedor_Proxy.__GetInterfaceName:string;
begin
  result := 'srvPedidosProveedor';
end;

function TsrvPedidosProveedor_Proxy.GetNextAutoInc(const GeneratorName: String): Integer;
var
  __request, __response : TMemoryStream;
begin
  __request := TMemoryStream.Create;
  __response := TMemoryStream.Create;

  try
     __Message.Initialize(__TransportChannel, 'FactuGES', __InterfaceName, 'GetNextAutoInc');
     __Message.Write('GeneratorName', TypeInfo(String), GeneratorName, []);
     __Message.Finalize;

     __Message.WriteToStream(__request);
     __TransportChannel.Dispatch(__request, __response);
     __Message.ReadFromStream(__response);

     __Message.Read('Result', TypeInfo(Integer), result, []);
  finally
    __request.Free;
    __response.Free;
  end
end;

function TsrvPedidosProveedor_Proxy.GenerateReport(const ID: Integer): Binary;
var
  __request, __response : TMemoryStream;
begin
  result := nil;
  __request := TMemoryStream.Create;
  __response := TMemoryStream.Create;

  try
     __Message.Initialize(__TransportChannel, 'FactuGES', __InterfaceName, 'GenerateReport');
     __Message.Write('ID', TypeInfo(Integer), ID, []);
     __Message.Finalize;

     __Message.WriteToStream(__request);
     __TransportChannel.Dispatch(__request, __response);
     __Message.ReadFromStream(__response);

     __Message.Read('Result', TypeInfo(Binary), result, []);
  finally
    __request.Free;
    __response.Free;
  end
end;

{ CosrvCobrosCliente }

class function CosrvCobrosCliente.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvCobrosCliente;
begin
  result := TsrvCobrosCliente_Proxy.Create(aMessage, aTransportChannel);
end;

{ TsrvCobrosCliente_Proxy }

function TsrvCobrosCliente_Proxy.__GetInterfaceName:string;
begin
  result := 'srvCobrosCliente';
end;

function TsrvCobrosCliente_Proxy.GetNextAutoInc(const GeneratorName: String): Integer;
var
  __request, __response : TMemoryStream;
begin
  __request := TMemoryStream.Create;
  __response := TMemoryStream.Create;

  try
     __Message.Initialize(__TransportChannel, 'FactuGES', __InterfaceName, 'GetNextAutoInc');
     __Message.Write('GeneratorName', TypeInfo(String), GeneratorName, []);
     __Message.Finalize;

     __Message.WriteToStream(__request);
     __TransportChannel.Dispatch(__request, __response);
     __Message.ReadFromStream(__response);

     __Message.Read('Result', TypeInfo(Integer), result, []);
  finally
    __request.Free;
    __response.Free;
  end
end;

function TsrvCobrosCliente_Proxy.GenerateReport(const CobroID: Integer): Binary;
var
  __request, __response : TMemoryStream;
begin
  result := nil;
  __request := TMemoryStream.Create;
  __response := TMemoryStream.Create;

  try
     __Message.Initialize(__TransportChannel, 'FactuGES', __InterfaceName, 'GenerateReport');
     __Message.Write('CobroID', TypeInfo(Integer), CobroID, []);
     __Message.Finalize;

     __Message.WriteToStream(__request);
     __TransportChannel.Dispatch(__request, __response);
     __Message.ReadFromStream(__response);

     __Message.Read('Result', TypeInfo(Binary), result, []);
  finally
    __request.Free;
    __response.Free;
  end
end;

{ CosrvConfiguracion }

class function CosrvConfiguracion.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvConfiguracion;
begin
  result := TsrvConfiguracion_Proxy.Create(aMessage, aTransportChannel);
end;

{ TsrvConfiguracion_Proxy }

function TsrvConfiguracion_Proxy.__GetInterfaceName:string;
begin
  result := 'srvConfiguracion';
end;

function TsrvConfiguracion_Proxy.darValor(const CODIGO: String): String;
var
  __request, __response : TMemoryStream;
begin
  __request := TMemoryStream.Create;
  __response := TMemoryStream.Create;

  try
     __Message.Initialize(__TransportChannel, 'FactuGES', __InterfaceName, 'darValor');
     __Message.Write('CODIGO', TypeInfo(String), CODIGO, []);
     __Message.Finalize;

     __Message.WriteToStream(__request);
     __TransportChannel.Dispatch(__request, __response);
     __Message.ReadFromStream(__response);

     __Message.Read('Result', TypeInfo(String), result, []);
  finally
    __request.Free;
    __response.Free;
  end
end;

{ CosrvMontajes }

class function CosrvMontajes.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvMontajes;
begin
  result := TsrvMontajes_Proxy.Create(aMessage, aTransportChannel);
end;

{ TsrvMontajes_Proxy }

function TsrvMontajes_Proxy.__GetInterfaceName:string;
begin
  result := 'srvMontajes';
end;

function TsrvMontajes_Proxy.GetNextAutoInc(const GeneratorName: String): Integer;
var
  __request, __response : TMemoryStream;
begin
  __request := TMemoryStream.Create;
  __response := TMemoryStream.Create;

  try
     __Message.Initialize(__TransportChannel, 'FactuGES', __InterfaceName, 'GetNextAutoInc');
     __Message.Write('GeneratorName', TypeInfo(String), GeneratorName, []);
     __Message.Finalize;

     __Message.WriteToStream(__request);
     __TransportChannel.Dispatch(__request, __response);
     __Message.ReadFromStream(__response);

     __Message.Read('Result', TypeInfo(Integer), result, []);
  finally
    __request.Free;
    __response.Free;
  end
end;

initialization
  RegisterROClass(TRdxLoginInfo);
  RegisterROClass(TRdxEmpresasArray);
  RegisterProxyClass(IsrvContactos_IID, TsrvContactos_Proxy);
  RegisterProxyClass(IsrvLogin_IID, TsrvLogin_Proxy);
  RegisterProxyClass(IsrvPresupuestos_IID, TsrvPresupuestos_Proxy);
  RegisterProxyClass(IsrvEmpresas_IID, TsrvEmpresas_Proxy);
  RegisterProxyClass(IsrvFacturasCliente_IID, TsrvFacturasCliente_Proxy);
  RegisterProxyClass(IsrvPedidosProveedor_IID, TsrvPedidosProveedor_Proxy);
  RegisterProxyClass(IsrvCobrosCliente_IID, TsrvCobrosCliente_Proxy);
  RegisterProxyClass(IsrvConfiguracion_IID, TsrvConfiguracion_Proxy);
  RegisterProxyClass(IsrvMontajes_IID, TsrvMontajes_Proxy);


finalization
  UnregisterROClass(TRdxLoginInfo);
  UnregisterROClass(TRdxEmpresasArray);
  UnregisterProxyClass(IsrvContactos_IID);
  UnregisterProxyClass(IsrvLogin_IID);
  UnregisterProxyClass(IsrvPresupuestos_IID);
  UnregisterProxyClass(IsrvEmpresas_IID);
  UnregisterProxyClass(IsrvFacturasCliente_IID);
  UnregisterProxyClass(IsrvPedidosProveedor_IID);
  UnregisterProxyClass(IsrvCobrosCliente_IID);
  UnregisterProxyClass(IsrvConfiguracion_IID);
  UnregisterProxyClass(IsrvMontajes_IID);

end.
