//
// Erzeugt vom DataSnap-Proxy-Generator.
// 11.09.2012 15:05:33
//
unit proxy;
interface
uses Data.DBXCommon, Data.DBXClient, Data.DBXDataSnap, Data.DBXJSON, Datasnap.DSProxy, System.Classes, System.SysUtils, Data.DB, Data.SqlExpr, Data.DBXDBReaders, Data.DBXJSONReflect;
type
TServerMethods1Client =
class(TDSAdminClient)
private
FEchoStringCommand: TDBXCommand;
FReverseStringCommand: TDBXCommand;
FUploadFileCommand: TDBXCommand;
public
constructor Create(ADBXConnection: TDBXConnection);
overload;
constructor Create(ADBXConnection: TDBXConnection; AInstanceOwner: Boolean);
overload;
destructor Destroy;
override;
function EchoString(Value:
string):
string;
function ReverseString(Value:
string):
string;
procedure UploadFile(str: TStream; Store:
string; FileName:
string);
end;
implementation
function TServerMethods1Client.EchoString(Value:
string):
string;
begin
if FEchoStringCommand =
nil then
begin
FEchoStringCommand := FDBXConnection.CreateCommand;
FEchoStringCommand.CommandType := TDBXCommandTypes.DSServerMethod;
FEchoStringCommand.Text := '
TServerMethods1.EchoString';
FEchoStringCommand.Prepare;
end;
FEchoStringCommand.Parameters[0].Value.SetWideString(Value);
FEchoStringCommand.ExecuteUpdate;
Result := FEchoStringCommand.Parameters[1].Value.GetWideString;
end;
function TServerMethods1Client.ReverseString(Value:
string):
string;
begin
if FReverseStringCommand =
nil then
begin
FReverseStringCommand := FDBXConnection.CreateCommand;
FReverseStringCommand.CommandType := TDBXCommandTypes.DSServerMethod;
FReverseStringCommand.Text := '
TServerMethods1.ReverseString';
FReverseStringCommand.Prepare;
end;
FReverseStringCommand.Parameters[0].Value.SetWideString(Value);
FReverseStringCommand.ExecuteUpdate;
Result := FReverseStringCommand.Parameters[1].Value.GetWideString;
end;
procedure TServerMethods1Client.UploadFile(str: TStream; Store:
string; FileName:
string);
begin
if FUploadFileCommand =
nil then
begin
FUploadFileCommand := FDBXConnection.CreateCommand;
FUploadFileCommand.CommandType := TDBXCommandTypes.DSServerMethod;
FUploadFileCommand.Text := '
TServerMethods1.UploadFile';
FUploadFileCommand.Prepare;
end;
FUploadFileCommand.Parameters[0].Value.SetStream(str, FInstanceOwner);
FUploadFileCommand.Parameters[1].Value.SetWideString(Store);
FUploadFileCommand.Parameters[2].Value.SetWideString(FileName);
FUploadFileCommand.ExecuteUpdate;
end;
constructor TServerMethods1Client.Create(ADBXConnection: TDBXConnection);
begin
inherited Create(ADBXConnection);
end;
constructor TServerMethods1Client.Create(ADBXConnection: TDBXConnection; AInstanceOwner: Boolean);
begin
inherited Create(ADBXConnection, AInstanceOwner);
end;
destructor TServerMethods1Client.Destroy;
begin
FreeAndNil(FEchoStringCommand);
FreeAndNil(FReverseStringCommand);
FreeAndNil(FUploadFileCommand);
inherited;
end;
end.