#3 mORMot 2 » Stuck with HTTP.sys registration error in TRestHttpServer » 2024-10-30 10:33:37

youssef
Replies: 4

I've been banging my head against the wall for the past few hours trying to get TRestHttpServer working with HTTPS. Every time I try to start the server, it fails with this error:

! OSERR    mormot.rest.http.server.TRestHttpServer(035F7860) http.sys URI registration error #183 for https://+:xxxx/root
! EXC      ERestHttpServer {Message:"TRestHttpServer: http.sys URI registration error #183 for https://+:xxxx/root"}

Here's what I'm trying to do:

MyServer.HttpServer := TRestHttpServer.Create(
  xxxxx,   
  [MyServer], 
  '+', 
  HTTP_DEFAULT_MODE, 
  16, 
  secTLSSelfSigned
);

I'm running the app as admin, and I've tried different ports and using '*' instead of '+' for the binding address, but no luck. The weird thing is that it works fine if I remove the HTTPS stuff, but I really need secure communication for this project.
I've looked through the documentation and searched the forum, but I can't figure out what I'm missing. Is there some special setup needed for HTTP.sys when using self-signed certificates? Or am I doing something completely wrong with the TRestHttpServer creation?

#4 mORMot 1 » TOrmTableDataSet3 being Read-Only after Loading Data via CreateFromJso » 2024-09-23 11:34:45

youssef
Replies: 2

I’m facing a problem where TOrmTableDataSet3 is read-only, preventing me from modifying the dataset.

I'm loading the dataset using TOrmTableDataSet.CreateFromJson. Here's the code I’m using for appending data:

UniEdit1.onkeyPress
  with DataSource1.DataSet do
    begin
      Append;
      FieldByName('NewQty').AsString := 'AG-' + Format('%', [UniEdit1.Text]);
    end;

However, I keep getting the error => TOrmTableDataSet3: Cannot modify a read-only dataset.

#5 Re: mORMot 2 » Question About Passing TOrmClass in Service Function Causing Access Vi » 2024-08-05 09:01:36

So, every time in the implementation, I need to do a case statement for each class like this:

case ClassType of
  User: DoSomething;
  Product: DoSomethingElse;
  ...
  ClassNumber15: DoAnotherThing;
  ...
end;
Is there a way to check which class is in the parameter and process it directly without having to check all cases one by one?

#6 mORMot 2 » Question About Passing TOrmClass in Service Function Causing Access Vi » 2024-08-05 08:20:03

youssef
Replies: 3

How can I create a function in a service that contains a parameter var aClass: TOrmClass and use it in a test unit? When I try to implement this, I encounter an access violation error. Could you please advise on the correct approach or what might be causing the issue?
function

Board footer

Powered by FluxBB