#101 mORMot 2 » BUG (or new feature) on SOA Calls » 2024-02-27 13:51:45

itSDS
Replies: 14

Hi Arnaud, today i get an error calling a simple SOA function:

here a part of the log:

27.02.2024 14:36:12.224	Enter	1	 mormot.soa.client.TServiceFactoryClient(18f37450).InternalInvoke IDomBelegverwaltung.GetAlleAuftraege("",1) 1
27.02.2024 14:36:12.224	Enter	1	    mormot.rest.http.client.TRestHttpClientWinHttp(18f738a0).InternalUri POST
27.02.2024 14:36:12.256	Client	1	       mormot.rest.http.client.TRestHttpClientWinHttp(18f738a0) POST LSYS/DomBelegverwaltung.GetAlleAuftraege/1?session_signature=000d4a4f0018aa4462b2baf2 status=200 len=692979 state=5
27.02.2024 14:36:12.256	Leave	1	    00.039.894
27.02.2024 14:36:12.256	Service return	1	    mormot.soa.client.TServiceFactoryClient(18f37450) {"result":[[{State:2,Anlagedatum:"2023-09-20T10:53:14",LetzteAenderung:"2023-12-14T15:08:53",....
27.02.2024 14:36:12.256	Leave	1	 00.046.140
27.02.2024 14:37:45.976	Exception	1	 EInterfaceFactory {Message:"TInterfacedObjectFakeClient.FakeCall(IDomBelegverwaltung.GetAlleAuftraege) failed: 'Invalid returned JSON content: expects {result:...}, got {\"result~:[[{State:2,Anlagedatum:\"2023-09-20T10:53:14\",LetzteAenderung:\"2023-12-14T15:08:53

As you can see the server sends everything ok, but in last line instead of result: there is \"result~: and other Strings are also escaped.

Not every SOA Call has this behavior, may be it depends on the amount of Data received.

#102 Re: mORMot 2 » Using Async Socket to Refresh Client » 2023-12-18 18:30:48

Hi Arnaud,, forget my last question, i read in other posts in the forum that the callback like approach will not work with WebSockets.
I'll do it in a different way smile

#103 Re: mORMot 2 » Using Async Socket to Refresh Client » 2023-12-18 12:05:55

Hi i have implemented a client Server for windows now. And the next step is to be notified on a Webpage using WebSocket

i tried it but WebSocket does not connect. So created a litte sample for your restws_chatserver.exe. But also can not connect.
Is there a sample on how to connect to that kind of WebSocket from JavaSript/html ?

I like to do something similar as with the ChatClient
Calling Join Funktion and receive the Chat in the Callback.

Sample (copied from : SimpleEchoServer - mormot1) but here i try to connect to Chatserver.

function init(){
  try
  {
    socket = new WebSocket("ws://localhost:8888/root/","synopsebin");
    log('WebSocket - status '+socket.readyState);
    socket.onopen    = function(msg){
		console.log(msg); 
		log("onopen: Welcome - status "+this.readyState); 
	};
    socket.onmessage = function(msg){ 
		console.log(msg); 
		log("onmessage: ("+msg.data.length+" bytes): " + (msg.data.length < 5000 ? msg.data : (msg.data.substr(0, 30) + '...'))); 
	};
    socket.onerror   = function(msg){ 
		console.log(msg); 
		log("onerror - code:" + msg.code + ", reason:" + msg.reason + ", wasClean:" + msg.wasClean + ", status:" + this.readyState); 
	};
    socket.onclose   = function(msg){ 
		console.log(msg); 
		log("onclose - code:" + msg.code + ", reason:" + msg.reason + ", wasClean:" + msg.wasClean + ", status:" + this.readyState); 
	};
  }
  catch(ex)
  {
    log(ex);
  }
  $("msg").focus();
}

ty

#104 Re: mORMot 2 » Using Async Socket to Refresh Client » 2023-12-13 19:46:45

I think i can solve it with the Samples from m2: ex/rest-websockets.

#105 mORMot 2 » Using Async Socket to Refresh Client » 2023-12-13 19:11:29

itSDS
Replies: 5

Hi Ab, is there a simple Solution to this Idea:

Lets say i have 10(or more) client showing data from my Server received with some SOA Calls.
Now one of the clients does some updates on the data and sends it to the server, using SOA - Update call.

Now i like the Server to inform the Client about data changes, to display the changed data.
I don't like to pull the Data every 5s from the client.
i like to have a kind of Push message from the Server to the clients interested in this message.

The Client could also be a Webseite using WebSockets.

Is it possible to use the same port as the SOA Server for the Socket Server or do i need a second port ?

i read this: https://blog.synopse.info/?post/2022/05 … n-mORMot-2

#106 Re: mORMot 2 » AutoReconnect in NewStatementPrepared does not work as expected » 2023-10-24 18:15:48

Ty Arnaud, for me it works now. Using the Cache is not so Important than a successful reconnect - for Performance.
Our Trafic is very low.

#107 mORMot 2 » AutoReconnect in NewStatementPrepared does not work as expected » 2023-10-24 12:18:47

itSDS
Replies: 2

Hi we have some Reconnect Problem (Backend is MySQL with UniDAC) by auth?/Username=

Let me Explain
We Connect a SOA Client with mormot Authentication.

For test Reason i build up a Query Cache by Calling 20 SOA - Calls from my SOA Client.
Then i disconnect/connect my MySQL Server (To Force a Connection lost)

After this the First SOA Call returns with Error 403 (unknown user)
(Here NewStatementPrepared finds the Statement: NewStatementPrepared(select ID,LogonName,DisplayName,PasswordHashHexa,GroupRights from DFSQLAuthUser where LogonName=? limit 1) in Cache and returns without Reconnect

The Next SOA Call works because NewStatementPrepared does a Reconnect.

What do you think ? Is there an Error in the Authentication because it does not reconnect ?

Here is a Screenshot from the Log: https://ufile.io/su7052wv

#108 mORMot 2 » Create SynCrossPlatform Wrapper with m2 broken » 2023-08-24 07:33:19

itSDS
Replies: 7

Hi Arnaud,

i like to remember to this Problem postet before:

https://synopse.info/forum/viewtopic.php?id=5835)

it would be nice to have the possibility to produce SynCrossplatform Client with m2 - is there any progress to expect ?

br

#110 mORMot 2 » howto quick check if Server is available » 2023-07-21 09:12:25

itSDS
Replies: 3

May be this is already discussed, but i don't know...

Im looking for an fast and resource - saving way to check if my Server is reachable.
like a ping.
is there something contained in mormot ?

#111 mORMot 2 » Stack Overflow in LogView » 2023-07-03 20:04:22

itSDS
Replies: 4

Hi Arnaud,

i get Stack Overflow in Log Viewer (64Bit) Not (32Bit) - Where Should i send the Log file ?

#112 mORMot 2 » Mobile SOA Client » 2023-06-15 11:07:40

itSDS
Replies: 1

Hi Arnaud,

im Thinking about to Replace SynCrossPlatform Client mainly for SOA - WebServices (from Mormot2)

Actually i use Windows Client which works Perfectly with it. But now i like to use this on Android/iOS Client without SynCrossPlatform Wrapper.
(One of the Reason is as in one of my former tickets - That i can not build SynCrossplatform Client for mormot2 (https://synopse.info/forum/viewtopic.php?id=5835))

The Client is very easy - Connect / SetUser
Then call the Interface functions.

But the whole interface seems to be optimized by Assembler Code.
For my Mobile i do not need that much speed, so i think a PUREPASCAL Implementation could be enough here. (And it will be automatically work on iOS / Android)

Is it Possible to build a Client for Mobile for this ? Or are there any plans ?

#113 Re: mORMot 2 » Utf8ToString does not support Chinese » 2023-05-11 12:53:56

just for my interest
in the above sample you use Writeln( with dst as parameter
i think writeln uses an implicit cast of RawUtf8 To String or am i wrong ?

#115 mORMot 2 » Question concerning SOA "Object" Parameter » 2023-05-11 11:47:44

itSDS
Replies: 2

Hey Arnaud, we call a SOA Interface function from a client.
we have 5 "Object" Parameter and 2 are initialized with nil on the Client.
On the Server this Parameter are not set to nil, they contain an "empty" Object. Is it possible to get the "nil" parameter.
Specially if one of the Parameter is an "out" Parameter, how is it with memory Management ?

Example:

TMyObject = class TSynPersistent...

interface...

function SOAFunktion(out AResultObject : TMyObject; const AParam1, Param2, AParam3 : TMyObject; const AParam4:TMyObject = nil) : TResultRecord;

Client Calls

var LResult : TMyObject := nil;
AServer.SOAFunction(LResult, p1, p2, p3, nil);

On the Server Side all 5 Objects does contain a TMyObject, p1-3 are the desired Objects. but AResultObject and AParam4 should be nil ?!

#117 mORMot 2 » Base64Magic Missing for SynCrossPlatform Client » 2023-04-25 13:30:57

itSDS
Replies: 2

Im not pretty sure "when" it changed. but we noticed today, that RawByteStrings (member of a record) are send without JSON_BASE64_MAGIC Chars at the beginning.

SynCrossplatformJSON's Base64JSONStringToBytes testet for this by default and as it is not present my Blob is not received.
I changed the Withbase64Magic to false and my Blob is received correct.

my m2 Record looks like this:


  RRecord = packed record
    dateiname : RawUtf8;
    groesseinbytes : integer;
    dateityp : RawUtf8;         
    dateidatum : TDateTime;
    dokument : RawByteString;   // <- This Data is send without magic
  end;

On Client it looks like this:

  RRecord = record
    dateiname: String;
    groesseinbytes: Integer;
    dateityp: String;
    dateidatum: TDateTime;
    dokument: TSQLRawBlob;
  end;


function Variant2RRecord (_variant: variant): RRecord;
var _a: integer;
    _arr: PJSONVariantData;
begin
  result.dateiname := _variant.dateiname;
  result.groesseinbytes := _variant.groesseinbytes;
  result.dateityp := _variant.dateityp;
  result.dateidatum := Iso8601ToDateTime(_variant.dateidatum);
  result.dokument := VariantToBlob(_variant.dokument);
end;

Is this the new "default" behavior or is it an Error ?

#118 Re: mORMot 2 » Problem with iOS Review/App Testing » 2023-04-20 11:22:06

@AB the Tester(from Apple) can access the MVC Server from the device Safari browser, but not the soa server from our app.
Syncrossplatformclient from m1 latest release.

#119 Re: mORMot 2 » Problem with iOS Review/App Testing » 2023-04-20 11:20:35

@dcoun - the m2 server is behind a iis reverse proxy, and is encrypted with https and Letsencrypt certificate

#120 mORMot 2 » Problem with iOS Review/App Testing » 2023-04-20 08:39:25

itSDS
Replies: 4

Hi alltogether, may be one of you encounterd the same Problem with a similar case.

we use m2 as server, this server has 2 function a mvc view which can be used to browse some data and a soa webservice with function called from a syncrossplatform client.

the Tester at apple uses an iphone connected by tethering.

The Tester can open the mvc pages and browse it, but as he uses our app, no connection can be established.
I think there is a kind of content filter blocking the SOA - Traffic.

Im not so deep in network so may you can help. Is there an option to let the SOA trafic look like normal website trafic as the mvc view - for the content filter.

Or does anyone have another thougt / clue

thank you in advance

I forgot to mention, we don't have the connection Problem with many other devices...

#121 Re: mORMot 2 » TLS Error Problem » 2023-02-20 10:09:30

sry arnaud, I defined both what meens it did not work defining both defines in Projekt-Options.

#122 Re: mORMot 2 » TLS Error Problem » 2023-02-18 13:58:35

I tried now with secTLSSelfSigned - Same Error
USE_OPENSSL - Here the initialization with NewOpenSslNetTls is not called (Set breakpoint) Do i have to set some more parameter ?

One more info the self signed certificate on my develop computer uses sha256RSA

#124 Re: mORMot 2 » TLS Error Problem » 2023-02-17 12:14:12

Ty i test it this weekend

#125 Re: mORMot 2 » TLS Error Problem » 2023-02-16 19:08:33

I testet it with a similar certificate on my Develop Computer and no Error ?!

#126 Re: mORMot 2 » TLS Error Problem » 2023-02-16 18:23:59

I made some further testing (Turned on AllowDeprecatedTls on Client / On Server i don't know how - pls help)

Starting Client on same Windows Server 2019
The WinHTTP Client runs without error.
The Socket Client with same error as before ESChannel: SEC_E_INVALID_TOKEN/ERROR_INVALID_PARAMETER. As i know Win2019 supports TLS 1,1.1,1.2 as Default.

There Error comes requesting Timestamp. In Server Log is no entry concerning the connection request. Something is wrong with tls settings in Socket Client for Windows.

#127 Re: mORMot 2 » TLS Error Problem » 2023-02-16 14:21:36

i dont think its a server problem. We have older server with older m2 Versoin running, but after updating the client to Versions newer than approx. mid 1/2023 we get the error.

#128 Re: mORMot 2 » TLS Error Problem » 2023-02-16 13:14:36

The Alghorithm is md5RSA

#129 Re: mORMot 2 » TLS Error Problem » 2023-02-16 12:55:52

The Client is Windows 10
The Server Windows 2019
The Client works with our https Website (Let's Encrypt) Certificate
algo - have to check
I'll try AllowDeprecatedTLS
ty

#130 mORMot 2 » TLS Error Problem » 2023-02-16 11:15:01

itSDS
Replies: 12

Hi Arnaud,

here i have 2 Log Entries one with Socket Client and one with WinHTTP Client
IgnoreSSLCertError is aktivated, also IgnoreTLSCertError.

https://postimg.cc/gallery/TKCBRS6

The Server uses a self signed certifikate only to encrypt (Internal Network)
The Client throws above Errors.

Very serious the WinHTTP Client throws error only on first connect. Subsequent Connects are successful

What can i do to connect ? Any Idea ?
Ty in advance

#131 Re: mORMot 2 » Error 400 Invalid URI calling SOA Function » 2023-02-08 19:19:32

Ok ty i have enhanced the SynCrossplatform Client to ask for instance and use Result as ClientID now.

#132 Re: mORMot 2 » Error 400 Invalid URI calling SOA Function » 2023-02-08 18:28:15

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 ?!

#133 Re: mORMot 2 » Error 400 Invalid URI calling SOA Function » 2023-02-08 14:19:39

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 ?

#134 Re: mORMot 2 » Error 400 Invalid URI calling SOA Function » 2023-02-08 14:05:38

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 ?

#135 mORMot 2 » m2 FMX Android/iOS Client » 2023-02-08 12:44:11

itSDS
Replies: 2

i Port this ticket from the m1 Forum, because i'm interested to have App Support / m2 App Client for m2
Old Link: https://synopse.info/forum/viewtopic.php?id=6356

#136 Re: mORMot 2 » Error 400 Invalid URI calling SOA Function » 2023-02-08 12:35:36

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 ?

#137 Re: mORMot 2 » Error 400 Invalid URI calling SOA Function » 2023-02-08 08:24:13

Here the deklaration part

  IDFLSYSConnector = interface(IInvokable)
    ['{DCBB296A-C209-4346-BD37-4496E32A50BE}']
    function GetStammdaten(const AAuthToken : RawUtf8; const AGeaendertNach : TDateTime = 0) : RStammdatenResult;
...

#138 Re: mORMot 2 » Error 400 Invalid URI calling SOA Function » 2023-02-08 08:14:31

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

#139 Re: mORMot 2 » Error 400 Invalid URI calling SOA Function » 2023-02-07 18:15:19

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 ?

#140 Re: mORMot 2 » Error 400 Invalid URI calling SOA Function » 2023-02-07 16:13:19

Trying to add / at the Beginning does not work. On Server lsysconnector/timestamp -> //lsysconnector/timestamp if i add your code sample.

#141 Re: mORMot 2 » Error 400 Invalid URI calling SOA Function » 2023-02-07 15:53:40

Here is the matching RadixTree:

https://postimg.cc/zHr9fz6V

May be the Backslash at stammdaten/ ?!

#142 Re: mORMot 2 » Error 400 Invalid URI calling SOA Function » 2023-02-07 15:43:16

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'

#143 Re: mORMot 2 » Error 400 Invalid URI calling SOA Function » 2023-02-07 12:11:34

One more Info: We use the Syncrossplatform Client from m1 to access the SOA Functions

#144 mORMot 2 » Error 400 Invalid URI calling SOA Function » 2023-02-07 12:07:15

itSDS
Replies: 17

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.

#147 Re: mORMot 2 » Exception in 64Bit of Mormot 2 but not in 32Bit Version » 2023-02-01 18:13:15

Hi i testet now a lot and my last test was to comment out your 64Bit ASM Code - And now it works.

I have made 2 Logs now where you can see the Exception in 64Bit Version if you like i can send it to you.

#148 Re: mORMot 2 » Exception in 64Bit of Mormot 2 but not in 32Bit Version » 2023-02-01 11:29:02

Here the Stack trace:
https://postimg.cc/8Fz1qcN2
https://postimg.cc/30Tpj2HM

On the Client site i call:       

Database.ServiceDefine([IDomVerwaltung], sicClientDriven, cVerwaltungContract);


if you need more info pls ask

#149 mORMot 2 » Error parsing .static files » 2023-01-31 20:58:22

itSDS
Replies: 4

Hi Arnaud, you modified TMvcRunOnRestServer.InternalRunOnRestServer
and now my Methodname '.static/js/chunk-vendors.51b2b211.js'
does not work any more depending on:

  p := pointer(MethodName);
  if GetNextItemMultiple(p, '/?', rawMethodName) = '/' then
    GetNextItemMultiple(p, '/?', rawFormat);

Get error 404 - File not found. Mormot is not looking for "js/chunk-vendors.51b2b211.js" it looks for "js"

I have subfolder's in the .static folder !

in V2.0.4496 the Methodname works as expected with:

  Split(MethodName, '/', rawMethodName, rawFormat);

As Workaround i removed the new code an replaced it with the old one.

#150 Re: mORMot 2 » Exception in 64Bit of Mormot 2 but not in 32Bit Version » 2023-01-31 20:48:58

Hi sry for the delay - was on holydays

The Exception is in the mORMot High Level Code. I don't use the lock by Myself its in the Context of TRestServerUriContext.Authenticate
(How can i upload an Image ?)

Board footer

Powered by FluxBB