Salve a tutti.
Sto scrivendo una classe in delphi per gestire un client rest che accede ai servizi di un webservice restful.La classe che attualmente assegna solo gli endpoint del werbservice a delle proprietà, mi dà subito errore all'interno della procedura Create dove cerca di valorizzare la variabile privata flogonEndPoint:=value;
Immagino l'errore sia banale ma non capisco dove sta. Qualcuno mi può aiutare?
Ecco il codice:
unit Restclient;
interface
uses
Classes, SysUtils;
type
TRestClient = class
private
flogonEndPoint :string;
fauthorizationEndpoint :string;
ftokenEndpoint :string;
fconsoleEndpoint :string;
fmailstatisticsEndpoint :string;
procedure SetLogonEndPoint(value:string);
procedure SetAuthorizationEndPoint(value:string);
procedure SetTokenEndPoint(value:string);
procedure SetConsoleEndPoint(value:string);
procedure SetMailStatisticsEndPoint(value:string);
public
property logonEndpoint :string read flogonEndPoint write SetLogonEndPoint;
property authorizationEndpoint :string read fauthorizationEndPoint write SetAuthorizationEndPoint;
property tokenEndpoint :string read ftokenEndPoint write SetTokenEndPoint;
property consoleEndpoint :string read fconsoleEndPoint write SetConsoleEndPoint;
property mailstatisticsEndpoint:string read fmailstatisticsEndpoint write SetMailStatisticsEndPoint;
constructor Create;
destructor Destroy; override;
end;
implementation
constructor TRestClient.Create;
begin
SetLogonEndPoint('https://services/logon.....');
SetAuthorizationEndPoint('https://services/auth...');
SetTokenEndpoint('https://services/auth');
SetConsoleEndpoint('https://services/console');
SetMailstatisticsEndpoint('https://services/stats');
end;
procedure TRestClient.SetLogonEndPoint(value:string);
begin
flogonEndPoint:=value;
end;
procedure TRestClient.SetAuthorizationEndPoint(value:string) ;
begin
fauthorizationEndpoint:=value;
end;
procedure TRestClient.SetTokenEndPoint(value:string);
begin
ftokenEndpoint:=value;
end;
procedure TRestClient.SetConsoleEndPoint(value:string);
begin
fconsoleEndpoint:=value;
end;
procedure TRestClient.SetMailStatisticsEndPoint(value:string );
begin
fmailstatisticsEndpoint:=value;
end;
destructor TRestClient.Destroy;
begin
// Always call the parent destructor after running your own code
inherited;
end;