You are not logged in.
Pages: 1
Many Thanks
We're back with TDateTime parameters and it works like a charm
Long live the mORMot!
All the best
Sylvain
Hi Peter
I've clients on both windows and android..
Your solution is precisely what I call a workaround
Note that when using TDateTime into classes or records, TDateTime fields are consistently serialized as strings.. it perfectly works on both android and windows..
As you say, TDateTime to string automatic serialization using ISO 8601 standard is the only fail safe way of handling dates as it allows interoperability with non-delphi clients.
In our ecosystem, we also have some java servlets and even native android applications consuming our mormot web services.
So probably the proper question is :
Why do syncommon & mormot units serialize TDateTime as numbers when used as interface method parameters as it seems to be handled as strings everywhere else?
All the best
Sylvain
Hello,
We're using mORMot since 2~3 years in our applications mainly for the services via interfaces feature.
I noticed what looks like an inconsistency in parameters serialization when using cross platform units.
- The server is a vcl windows service using regular mormot units
- The client is a firemonkey application using the cross-plaform dedicated ones.
I'm exchanging complex objects structures containing TDateTime fields without any issue but yesterday I had to define some TDateTime parameter in a method definition.
IMyService = interface(IInvokable)
procedure MyProc(const inSomeTime: TDateTime);
end;
Calling this method from my fmx client, I received some 406 error indicating that the parameter 'inSomeTime' was missing.
The parameter is serialized as a string in cross platform units, when it's expected as a number in regular mormot units.
If I replace the TDateTime by a simple record, it works just fine.
TMyTime = packed record
Value : TDateTime;
end;
I worked around the issue but wanted to let you know, hoping I'll be able to remove my workaround some day.
Thanks for all your great work
Sylvain
---
PS : by the way, latest rev of SynCrossPlatformREST does not compile on windows.
Hi, sorry for resurrecting an old topic but I'm facing the exact same issue.
I can use SynECC to perform JWT authentication between delphi clients, it works pretty fine exchanging the public part of the ECCCertificate as base64.
But I also would like to let non delphi clients (java & javascript) use my mormot services.
I can't find a way to export the public key so that its usable by other standard jwt libs (e.g auth0:jwt in java).
What would be the proper way to deal with this issue?
Pages: 1