DA VCL to ISAPI

I’m in the process of converting a VCL DA project to an ISAPI dll. I have followed the limited info in http://old.wiki.remobjects.com/wiki/Platform_FAQs_(Data_Abstract)#How_do_I_create_an_ISAPI_DLL_with_Data_Abstract.3F

I used option 1 where I first created the server as a VCL project and then create a RO ISAPI in the same folder. After that I added all the units from the VCL project to the ISAPI project. I also replaced the #ROGEN declaration with the RODL file from the original VCL server.

After that I removed the IndyHttpServer component and replaced it with the WebBrokerServer component. Then I set the dispatcher properties accordingly

object Server: TROWebBrokerServer
Active = True
Dispatchers = <
item
Name = 'Message’
Message = Message
Enabled = True
PathInfo = '/BIN’
end>
SendClientAccessPolicyXml = captAllowAll
Left = 48
Top = 8
end

In the VCL, I run the server and got the correct output in the browser (http://localhost:8099) Once I patch the ISAPI dll into the IIS, there is no output at all. (http://localhost/isapi_scripts/MyISAPI.dll/bin). I have used the same IIS server for other ISAPI dll’s and those work good. I also tested the MegaDemo ISAPI project, and the MegaDemoISAPI.dll outputs XML (with or without the /bin path)

As the explanation in the above mentioned url is quite short, I must for sure have forgotten to do something. Any pointers on what more I have to do to get it working would be great

Thanks
Eivind

It’s a known Delphi behavior, this call

  Application.CreateForm(TServerDataModule, ServerDataModule);

doesn’t assign ServerDataModule for isapi.

workaround: assign it manually in OnCreate event:

procedure TServerDataModule.DataModuleCreate(Sender: TObject);
begin
  ServerDataModule := Self;
end;

in additionally, you may need to assign SessionManager and EventRepository manually in _Impl, like

procedure TDataService.DataAbstractServiceCreate(Sender: TObject);
begin
  Self.SessionManager := ServerDataModule.SessionManager;
  Self.EventRepository := ServerDataModule.GetEventRepository;
end;

Thanks for the info. I have set the ServerDataModule := Self; and Self.SessionManager := ServerDataModule.SessionManager in _Impl units.

However, my ServerDataModule does not have a GetEventRepository property. Should it? Do I need to drop a EventRepository from the component palette?

The ISAPI.dll still does not output any data so I guess I’m going to have to fix the GetEventRepository issue

Any further info would be great!

Eivind

no, this is optional component and is needed only you are using event sinks

can you create a simple testcase for this, pls? I’ll review and can detect what is wrong.
You can use PCTrade or Simple database shipped with DAD.