Data Abstract ISAPI Server - How To?

How do you create a Data Abstract ISAPI server? The link ( http://old.wiki.remobjects.com/wiki/Platform_FAQs_(Data_Abstract)#How_do_I_create_an_ISAPI_DLL_with_Data_Abstract.3F ) to the old wiki that I found does not work.

Thanks

Where was this link from?

Do you have any additional information as to how to complete the task of converting a Data Abstract standalone server into an ISAPI module?

Thank you

I’ll have to have someone from the RO team answer this, but unfortunately they were off today for a local holiday. Someone will help you out tomorrow — my apologies for the delay.

No problem.Thanks.

BTW: Did you get my PM?

i did, yeah. will handle first thing tomorrow, no worries…

Thanks :slight_smile:

the easiest way is create a new RO ISAPI project in the same folder and add all the units from your DA server to it. Also remove the {#ROGEN line in the new ISAPI project, and copy the one from your DA server (so your ISAPI now references the same RODL file).

Basically you now have two projects with identical server code, one VCL/Combo, and one ISAPI.

This, of course, works with any other server type RO supports.

Known issues with ISAPI:

  • you may need to assign SessionManager and EventRepository (if they are used) manually in OnCreate event of your _Impl files because they may have nil value in run–time.
  • ISAPI application doesn’t assign variables in CreateForm:
  Application.CreateForm(TServerDataModule, ServerDataModule);

so you have to assign ServerDataModule variable manually in TServerDataModule.OnCreate event like

  ServerDataModule := Self;

Do you have an example project you can share?

Also the one I am trying to convert is a code first DA project so there is no more rodl file.

Thanks

pls see example: DA_isapi.zip (151.2 KB)

in case CodeFirst project, you don’t need to include {#ROGEN and {$R RODLFile.RES} into isapi project

I noticed the following in the project file’s source code for your example:

if ROStartService(‘VCLApplicationServer’, ‘VCLApplicationServer’) then begin
ROService.CreateForm(TServerDataModule, ServerDataModule);
ROService.Run;
Exit;
end;

This would make it appear as though the example is able to be run as a Windows service. Is this correct?

If so, in the example you have moved the Server component from the server’s data module to the server’s main form. The code above would seem to indicate that the server form is not created when the server is run as a Windows service. Wouldn’t moving the server object to the main form break the functionality of the Windows service then?

originally, you wanted to have DA ISAPI server only :slight_smile:

of course, you can launch DA server as windows service.
I’ve moved those components to main server form for avoiding possible problems with isapi app that uses the same server datamodule.

you can return those components back to server datamodule and add some condition for isapi server like

procedure TServerDataModule.ModuleCreate(Sender: TObject);
begin
{$IFNDEF ISAPI}
  Server.Active := True;
{$ENDIF}
  ServerDataModule := Self;
end;

Yes, that is exactly what I need. I was just making sure that everything was correct in case anyone else finds the example and wants the standalone/combo as well as isapi.

Thanks again

I wrote a blog article describing the process of converting a code-first Data Abstract server into an ISAPI module.

http://angelictech.com/2018/04/convert-a-data-abstract-code-first-server-to-an-isapi-module/

2 Likes