[Lazarus] SQLDBRestBridge
duilio foschi
octopushole at gmail.com
Tue Nov 8 19:15:52 CET 2022
I am puzzled by TMS Software.
1. there is one demo specific for SQLDBRestBridge, but the
application is obviously bugged, as you see from the following
screenshot
https://i.ibb.co/m4wVGtM/2.jpg
as a start, the code for the login and logout button is the same, what cannot be
2. the support will deny even under torture the idea that TMS code can
have bugs. The fault is always yours. You did not read the manual
carefully (666 pages) or did not study CORS carefully or have
knowledge gaps. All true in my case... but I can see a bug when I meet
one :)
3. in the end, they will suggest you buy their bridge solution, called
XData, as they cannot waste their time with a bridge server they did
not write (verbatim) :)
Probably (I reckon) they are not very interested in the Lazarus
market, as they gain most income from the Delphi market.
As a matter of fact, I find their support not helpful at all. They
dont help you to solve your problem: they will deny that a problem
exists or will pretend that you will be able to solve your problem
after a few months' study of technical documentation :)
I bought TMS Web Core months ago with the idea of quickly write web
applications in Lazarus, with a special aim at their
TWebGridComponent, but I can say today that it was no wise purchase :)
Thank you
Peppe
On Tue, Nov 8, 2022 at 7:56 AM Michael Van Canneyt via lazarus
<lazarus at lists.lazarus-ide.org> wrote:
>
>
>
> On Mon, 7 Nov 2022, duilio foschi wrote:
>
> > I fixed the code in Lazarus and got a client based on BufDataClient
> > that successfully talks with a restbridge server.
> >
> > As a next step, I'd like to connect to the same server from a TWebForm
> > of TMS Web Core library.
>
> Normally, TMS Web Core contains a dataset component that handles SQLDBRest
> connections?.
>
> I wrote it myself for them.
>
> >
> > I started with a slow step. There is only a TWebHttpRequest in the
> > form (which has the same functions of a TFPHTTPClient) and it issues a
> > GET to URL
> > http://localhost:3000/metadata/?fmt=json&humanreadable=0
> >
> > This command works ok in the windows client.
> >
> > Here, I get the errors shown in pic
> > https://i.ibb.co/dpsjfQQ/1.jpg
> >
> > The message (a CORS error) is attached below.
>
> Aaaahhh... Welcome to CORS hell... :/
>
> >
> > Weird enough, the message is there even after changing the server code
> > in this way:
> >
> > original code:
> > FDisp.DispatchOptions:=FDisp.DispatchOptions+[rdoCustomView,rdoHandleCORS];
> >
> > new code
> > FDisp.DispatchOptions:=FDisp.DispatchOptions+[rdoCustomView];
>
> This is the exact opposite of what you should do.
>
> The rdoHandleCORS option must be there, or CORS will not be handled at all.
>
> >
> > Is there a way to tell the server to ignore CORS errors?
> >
>
> The CORS errors are from the browser, not from the server.
>
>
> > Or there a way to sweet-talk the server to accept the requests from a
> > TMS Web form? :)
>
> Yes, you must add localhost as an allowed origin in CORSAllowedOrigins.
>
> FDisp.CORSAllowedOrigins:='localhost:3000'
>
> If you are not using authentication, as an alternative, you can try
> FDisp.CORSAllowedOrigins:='*'
>
> Michael.
> --
> _______________________________________________
> lazarus mailing list
> lazarus at lists.lazarus-ide.org
> https://lists.lazarus-ide.org/listinfo/lazarus
More information about the lazarus
mailing list