Jump to content

Can ICS setup as Windows Service

Recommended Posts



I'm trying to build a webservice using Overbyte ICS THTTPAppServer component, i plan to run it as a windows service, i've setup the windows service but got problem when trying the AddGetHandler, the class to handle the request seems not recognized. It failed on line : 948 : TMyHttpHandler(Proc)(FLags); on file OverbyteIcsHttpAppServer.pas. It cause access violation.


My Setup is the usual windows service template, and i run the HTTPAppServer on serviceStart event


The webserver is working, i'm trying using the FHTTPServer.AddGetAllowedPath('/', afBeginBy); routine and it can handle the request


Problem only when try to access the URLHandler. so is it possible to make HTTPAppServer as windows service? And how to setup it correctly


Thank you


Share this post

Link to post

Look at the new sample OverbyteIcsSslMultiWebServ.dpr in \Samples\delphi\sslinternet\, this is effectively a commercial web server using THTTPAppServer and lots of AddGetHandler, with a minimal interface designed to be used as a Windows service. 


I will be adding another ICS sample shortly using the DDService environment once I've brought it up to date for new compilers, but the ICS code will be identical. 


Your exception must relate to code you've written in the handler, add some error handling.




Share this post

Link to post
On 10/7/2019 at 4:46 AM, DMX78 said:

I'm trying to build a webservice using Overbyte ICS THTTPAppServer component

Beside the sample Angus mentionned, you may also have a look at the sample OverbyteIcsSvcTcp.dpr. It is a simple service using TWSocket. Replacing TWSockt by any other ICS component do not really change the code. Note that this sample is organized so that the server code can be used within a normal application which is also provided (OverbyteIcsSrvTcp.dpr). The actual server code, common to the service and the application can be found in OverbyteIcsTcpCmd.pas.


It is much easier to develop using this dual application (Normal and service): you mainly debug the normal application and when it works correctly, you recompile using the service environment.


F. Piette



Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now