You are not logged in.
Pages: 1
Hi Arnaud,
with yesterday tests i experience an Error 400 calling SOA Functions.
This Error comes not with Version 4496 but exists with Version 4665.
Sry the Repository Version between this 2 i don't have.
If you need more input I'll try to provide it.
Rad Studio 12.1 Santorini
Offline
One more Info: We use the Syncrossplatform Client from m1 to access the SOA Functions
Rad Studio 12.1 Santorini
Offline
Try to add '/' in the beginning of all requested URI:
procedure TSQLRestClientURI.URI(var Call: TSQLRestURIParams);
...
if (Call.Url<>'') and (Call.Url[1]<>'/') then
Call.Url := '/'+Call.Url;
InternalURI(Call);
...
If it is not enough, please post here the actual values of Call.Url from the client side.
And try to debug on the server side why it is not routed as expected, e.g. in TRestRouter.Lookup().
Online
Hi Arnaud, i see TRestRouter.Lookup is new
There is the Problem, it does not find my Function (GetStammdaten) But Stammdaten is in the tree under Get (GetStammdaten, GetArtikel, ...) i have 4 Methods starting with get.
The Value of Call URL is : 'LSYSConnector/DFLSYSConnector.GetStammdaten?session_signature=000e153ce78f9d46a320304d'
Last edited by itSDS (2023-02-07 15:49:16)
Rad Studio 12.1 Santorini
Offline
Here is the matching RadixTree:
May be the Backslash at stammdaten/ ?!
Last edited by itSDS (2023-02-07 15:54:27)
Rad Studio 12.1 Santorini
Offline
Trying to add / at the Beginning does not work. On Server lsysconnector/timestamp -> //lsysconnector/timestamp if i add your code sample.
Rad Studio 12.1 Santorini
Offline
The tree seems correct: you need to look at FullUrl field to see the actual URI.
Because at each node level, you only have the new text in Chars[].
So there is a 'get' node, with 'stammdaten' sub-node for 'getstammdaten' URI.
Online
You can see the fullurl in the bottom line of my Screenshot.
There is a slash at the end. That's the reason why Lookup fails. In Requested URL is no slash at the end but ?session...
In the former Version 4495 the String was accecpted.
I think it's a missing feature in new Lookup Method - what do you think ?
Last edited by itSDS (2023-02-07 18:18:05)
Rad Studio 12.1 Santorini
Offline
Where does this trailing '/' come from?
On my side, TRestServerRoutingRest.UriComputeRoutes register the routes with no trailing /
Please post on a gist your full tree content:
You can just uncomment line 6829 of mormot.rest.server - writeln(r.Tree[mPOST].ToText);
For instance, here is a tree during SOA regression tests: https://gist.github.com/synopse/8b994c0 … 1dce6296eb
Online
Here is the Tree:
lsysconnector/
dflsysconnector
/
get
a
usgabemengen/
<clientid>
rtikel/
<clientid>
stammdaten/
<clientid>
inventur/
<clientid>
belege/
<clientid>
sende
inventur/
<clientid>
artikel/
<clientid>
belege/
<clientid>
druckeb
arcode/
<clientid>
eleg/
<clientid>
_
free_/
<clientid>
instance_
contract_
.
get
a
usgabemengen/
<clientid>
rtikel/
<clientid>
stammdaten/
<clientid>
inventur/
<clientid>
belege/
<clientid>
sende
inventur/
<clientid>
artikel/
<clientid>
belege/
<clientid>
_
free_/
<clientid>
contract_
instance_
druckeb
arcode/
<clientid>
eleg/
<clientid>
cacheflush
/
<fulluri>
wrapper
/
<fulluri>
batch
Rad Studio 12.1 Santorini
Offline
Here the deklaration part
IDFLSYSConnector = interface(IInvokable)
['{DCBB296A-C209-4346-BD37-4496E32A50BE}']
function GetStammdaten(const AAuthToken : RawUtf8; const AGeaendertNach : TDateTime = 0) : RStammdatenResult;
...
Rad Studio 12.1 Santorini
Offline
In sicClientDriven mode?
My guess is that it should rather be in sicShared mode on server side.
Your previous code worked by chance with the cross-platform clients.
You should specify sicClientDriven also on client side, to have the trailing /<clientid> specified in the client URI.
Online
The Problem is only with the Syncrossplatform Client. The normal m2 Client works.
I use sicClientDriven on both Sides.
I just changed sicClientDriven on Server Side to sicShared, and the Error is gone.
Are there any things i have to change on the Server now ?
Is this the right way - Change Mode on Server ?
Rad Studio 12.1 Santorini
Offline
Sry i have to add this, i read the Doku for sicShared / sicClientDriven again.
I need sicClientDriven on the Server Settings, my Server Implementation affords this. There are Client specific var i share between all "Client" requests. The Server Implmentation is needed for every client.
Do i have to provide the Client ID now in SynCrossplatformclient ? and how ?
Rad Studio 12.1 Santorini
Offline
Now i checked the URL called from one of the m2 client and you add e.g. stammdaten/1?session_ .. as ClientID to the request where is this clientid generated ? i think it should be on the Server or ?
Rad Studio 12.1 Santorini
Offline
Hi Arnaud,
what should i do now.
I have to use SynCrossplatformclient on my App - Client Side (it is the only client i have atm). But i have to use it with sicClientDriven on Client and Server side. (or am i wrong ?)
You have enhanced m2 with a clientID. But i don't know how to enhance Syncrossplatformclient to use/get it.
atm im lost here ?!
Rad Studio 12.1 Santorini
Offline
And it works by chance/error before in your case: without any /<clientid> the server does not know which server instance to use, so it should reject it.
As the new code does.
Try to look on the client side why the /<clientid> trailer is not transmitted to the server.
Perhaps the mORMot 1 cross-platform client does not make what is required.
In sicClientDriven mode, the clientid is a number returned by the server when /_instance_ is called.
It will identify the server class instance to use for executing the service method for this unique client.
Then, at client shutdown, in sicCLientDriven mode, the client should call /_free_/<clientid> to release the server class instance.
Online
Ok ty i have enhanced the SynCrossplatform Client to ask for instance and use Result as ClientID now.
Rad Studio 12.1 Santorini
Offline
Pages: 1