#2 mORMot 1 » Test Android application JMeter » 2017-03-06 10:07:18

ep
Replies: 10

Hello,

I'm trying to do a load test for my server and my android application with JMeter.

I set JMeter on the port 8080 and i declare the proxy on the port 8080 in my wifi profile of the android device to send mormot http request to JMeter too.

Here the problem, Once JMeter started, it doesn't handle anything when i connect to the mormot server.

Also, i saw related post with proxy definition and i change my code to define proxy in the tsqlresthttpclient :

FClient := TSQLRestClientHTTP.Create(aIP,
                                         aPort,
                                         FModel,
                                         false,
                                         false,
                                         '192.168.99.44',
                                         '8080',
                                         30000,
                                         30000,
                                         5000
    );

But it changes nothing...

Does someone have a feedback with the use of JMETER and MORMOT please ?

#4 mORMot 1 » Android rest client authentification » 2017-02-08 17:12:52

ep
Replies: 4

Hi All,

I'm trying to connect my FMX app created with Delphi XE7 to my Server mormot but i don't handle the basic authentification process...
The final goal is to store some values from the client in the session like the current version of the app to retrieve it when the client call a method (i think i need to define the service with sicPerSession to get the data from the CurrentServiceContext).

When i do SetUser on the client i have an error server-side : "Invalid TAuthSession.Create(TSQLREstRoutingRest, TSQLAuthUser)".
I tried with TSQLRestServerAuthenticationNone and Server := TSQLRestServerFullMemory.Create(Model, false); to check if i can connect without control access but i have the same message.
Any idea about what i'm doing wrong ?
I have the 1.18 version of the framework.

Thanks in advance.

PS : I checked the samples, but i didn't found a fmx client (crossplatform units) which call SetUser to login to a server.


here some code about :

// SERVER SIDE

procedure TMainDM.CreateUsers;
var
  lGrp:TSQLAuthGroup;
  lUser:TSQLAuthUSer;
begin
  lGrp := TSQLAuthGroup.Create;
  try
    if Server.Retrieve('Ident=User', lGrp) then
    begin
      lUser := TSQLAuthUser.Create;
      try
        lUser.LogonName := 'TEST';
        lUser.DisplayName := 'TEST';
        lUser.GroupRights := lGrp;
        lUser.PasswordPlain := '';
        lUser.Data := '';
        Server.AddOrUpdate(lUser, true);
      finally
        FreeAndNil(lUser);
      end;
    end;
  finally
    FreeAndNIl(lGrp);
  end;
end;

procedure TMainDM.DataModuleCreate(Sender: TObject);
begin
  // initialize a TObjectList-based database engine
  Model := TSQLModel.Create([TSQLAuthGroup, TSQLAuthUser]);
  Server := TSQLRestServerFullMemory.Create(Model, true);
  Server.CreateMissingTables;
  Server.AuthenticationRegister(TSQLRestServerAuthenticationDefault);
  CreateUsers;
  // launch the HTTP server
  HTTPServer := TSQLHttpServer.Create('7277',[Server],'+',useHttpSocket);
  HTTPServer.AccessControlAllowOrigin := '*'; // for AJAX requests to work
end;


// CLIENT SIDE

const
_SERVERIP = 'localhost';
_SERVERPORT = 7277;


procedure TForm1.ButtonCoClick(Sender: TObject);
begin
  if not FCLient.Connect then
  begin
    log.d('Can''t connect !!!');
    exit;
  end;
  if FClient.ServerTimeStamp = 0 then
  begin
    log.d('Server incorrect !!!');
    exit;
  end;

  if not FCLient.SetUser(TSQLRestServerAuthenticationDefault, 'TEST', '') then
  begin
    log.d('Can''t login !!!');
    exit;
  end;
  showmessage('CONNECTED !');
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  FModel := TSQLModel.Create([]);
  FClient := TSQLRestClientHTTP.Create(_SERVERIP, _SERVERPORT, FModel);
end;

Board footer

Powered by FluxBB