You are not logged in.
Pages: 1
thanks!
How do I save the session using TSQLRestServerFullMemory
procedure TRestServer.UserLogin(CTXt:TSQLRestServerURIContext);
var
User:TUserInfo;
P:PUTF8Char;
js:string;
SessionID:integer;
begin
User :=TUserInfo.Create;
try
if UrlDecodeNeedParameters(Ctxt.Parameters,'USERINFO') then
begin
UrlDecodeObject(CTXt.Parameters,'USERINFO=',User);
end;
finally
FreeAndNil(User);
end;
end;
Does mormot support raspberry Raspberry Pi 3?
arm linux
Parameter must be uppercase?
UrlDecodeObject (CTXt.Parameters, 'USERINFO =', User);
I mean that I only use the restuful part also need to build such an object TSQLMODEL? This coupling is too tight
My ClientCode
procedure TestRestfullHttpClient.SetUp;
begin
inherited;
FModel :=TSQLModel.Create([TUserInfo],'service');
FClient :=TSQLRestClientURINamedPipe.Create(FModel,'RestService');
end;
procedure TestRestfullHttpClient.TearDown;
begin
FreeAndNil(FClient);
inherited;
end;
procedure TestRestfullHttpClient.TestRestuFullClientAccess;
var
UserInfo :TUserInfo;
begin
UserInfo :=TUserInfo.Create;
try
UserInfo.UserName :='EricWang';
UserInfo.Password :='123456';
UserInfo.SessionKey :='sldkjfa;lkdjf';
UserInfo.Version :='1.125';
UserInfo.ProductID :=3;
Fclient.CallBackGetResult('UserLogin',[UserInfo]);
finally
FreeAndNil(UserInfo);
end;
My ServerCode
unit frm_Server;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs,SynCommons,mORMot,mORMotHttpServer,data_record,
Vcl.StdCtrls;
type
THttpServer=class(TSQLRestServerFullMemory)
published
procedure UserLogin(CTXt:TSQLRestServerURIContext);
end;
TForm1 = class(TForm)
Button1: TButton;
procedure FormDestroy(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
FModel: TSQLModel;
{ Private declarations }
FServer:THttpServer;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormDestroy(Sender: TObject);
begin
if Assigned(FServer) then FreeAndNil(FServer);
if Assigned(FModel) then FreeAndNil(FModel);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
button1.Enabled :=false;
if Assigned(FServer) then FreeAndNil(FServer);
if Assigned(FModel) then FreeAndNil(FModel);
FModel :=TSQLModel.Create([TUserInfo],'service');
FServer :=THttpServer.Create(FModel);
FServer.ExportServerNamedPipe('RestService');
Button1.Enabled :=true;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
end;
{ THttpServer }
procedure THttpServer.UserLogin(CTXt:TSQLRestServerURIContext);
var
User:TUserInfo;
P:PUTF8Char;
begin
//
//
P :=CTXt.Parameters;
end;
end.
I tried this code Fclient.CallBackGetResult ('UserLogin', [UserInfo]);
but httpserver recive nil ctxt.parmaters
procedure THttpServer.UserLogin (CTXt: TSQLRestServerURIContext);
var
User: TUserInfo;
P: PUTF8Char;
begin
//
//
P: = CTXt.Parameters;
end
I would like to send the TSQLrecord object to restful server how do i do?
I found that I used sample06 client to build a tsqlmodel
What is the use of TSQLmodel?
Mormot doesn't seem to be a lightweight architecture; I want to use only restful parts of the database, use unidac or something else, but it seems that only the mort architecture can be used to access the database
Hi Ab
Is mormot able to build a framework for supporting large data?
example :Hadoop (hdfs+mapreduce, hbase )
usually i can use this unit process data filter operatoion
this unit support > < >= <= AND OR NOT Equal operotor. you can easily extend support XML Json Csv and other data file search filter.
This is My Project address
https://github.com/Ericwang1104/PasExpressParser
This is a simple version, you can easily extend support for csv json xml and other data formats
hi ab:
I have an expression parser unit that wants to join mormot ,
Do you need it?
errorinfo:
:\fpcupdeluxe\fpcbootstrap\make.exe: *** [build-stamp.x86_64-linux] Error 2
fpcupdeluxe: ERROR: FPCCrossInstaller (BuildModuleCustom: FPC): Running cross compiler fpc make all for x86_64-linux failed with an error code.
fpcupdeluxe: ERROR: FPCCrossInstaller (BuildModuleCustom: FPC): Error running !
fpcupdeluxe: ERROR: Sequencer (FPCBuildOnly): Failure running fpcupdeluxe: error executing sequence FPCBuildOnly; line: 2, param: FPC
fpcupdeluxe: ERROR: Sequencer (Only): Failure running fpcupdeluxe: error executing sequence Only; line: 2, param: FPCBuildOnly
ERROR: Fpcupdeluxe fatal error !
Building cross-tools failed ... ??? ... aborting.
this is my open source project you can add to Mormot
https://github.com/Ericwang1104/PascalObjectSeralize
Pages: 1