#1 2014-09-09 06:34:17

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 516

Crossplattform XE7 iOS Mobile Client

Hi AB i tried to connect an universal firemonkey Client to one of my mORMot Servers but the connection was refused.

i found this article: http://synopse.info/forum/viewtopic.php?id=1976
it seems to have the same Problem.

Under normal Windows Client this code works to connect to the Server:

  CompressShaAesSetKey('xyz');
  FDatabase := TSQLHttpClient.Create(Server,APort,FModel);
  FDatabase.Compression := [hcSynShaAes];
  FDatabase.SetUser('User','synopse');

on Server Side i register the Database with this code:

  DB := TSQLRestServerDB.Create(Model,AppPath + 'database.db3',true);
  AddToServerWrapperMethod(DB, ['..\..\..\CrossPlatform\templates']);
  CompressShaAesSetKey('xyz');
  Server := TSQLHttpServer.Create('5001',[DB],'+',useHttpApiRegisteringURI, 32, secSynShaAes);

How can i connect to this Server with the generated code ?
atm i'm using:

  Client := GetClient('myurl.url', 'user', 'synopse');

Have i to remove the encryption on Server Side ?

I think best way would be to generate code which could connect automatically.

Last edited by itSDS (2014-09-09 06:35:40)


Rad Studio 12.1 Santorini

Offline

#2 2014-09-09 07:42:39

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Crossplattform XE7 iOS Mobile Client

It should work even with hcSynShaAes.
In fact, this hcSynShaAes encryption is not mandatory: it is used if both sides do support it.
If the client does not support hcSynShaAes (like one of our CrossPlatform client), it won't just use it.

So the issue is somewhere else.
Are you sure you can connect to the server?
Is the port 5001 open on your Windows firewall?
Can you connect via http, using plain browser, to the server URI, from the mobile?

Online

#3 2014-09-09 08:47:27

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 516

Re: Crossplattform XE7 iOS Mobile Client

sry ab i found the Error: SetUser is case sensitive and i wrote user not User as username sad

Last edited by itSDS (2014-09-09 08:48:29)


Rad Studio 12.1 Santorini

Offline

#4 2014-09-09 09:06:23

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 516

Re: Crossplattform XE7 iOS Mobile Client

IDEA:

May be i could have found my error easier if the error was not "bad request".
Is it possible to give error Messages like "unknown user", or "wrong password" ?


Rad Studio 12.1 Santorini

Offline

#5 2014-09-09 09:12:22

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Crossplattform XE7 iOS Mobile Client

Are you sure it is not already the case in the transmitted JSON?

In all cases, thanks for your feedback, since I do not own any iPhone so I was not able to fully test this mobile platform.
8)

Online

#6 2014-09-09 09:16:39

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 516

Re: Crossplattform XE7 iOS Mobile Client

The Server reply is:

{
"ErrorCode":400,
"ErrorText":"Bad Request"
}

Rad Studio 12.1 Santorini

Offline

Board footer

Powered by FluxBB