ISAPI Modules

Example for using DWS in a ISAPI Module

After installing DWS components - see installation.html - you can build your first CGI/ ISAPI/ NSAPI app within 5 minutes!

  1. Click "New..." in the Delphi menu, select Web App from templates.
  2. Place DelphiWebScript, dwsUtilLib, dwsISAPIlib and dwsPageProducer components into the Web App Form and tie Libs to the Script component by selecting it in the script-property in Object Inspector.
  3. Double click into the Form to open WebactionList. Select /default action and select dwsPageProducer in the Producer-property in Object Inspector.
  4. Compile it you have just built a complete ISAPI script engine dll for MS IIS!

If you copy the file "dwsISAPI.dll" into your webservers "scripts" directory you can access a html page with embedded DelphiWebScript and see result in your browser.

Enter http://localhost/scripts/dwsISAPI.dll/myscript.dws

This should execute the script "myscript.dws" in the wwwroot directory of your webserver.

note: your webserver should be capable to use ISAPI modules like MS PWS or MS IIS v:-)

Yet an other note: in MS IIS 4.0 you can link a file extension to a ISAPI module. If you link ".dws" to your dwsISAPI.dll you can address scriptfiles directly while dwsPageProducer gets the right path from webserver to load your script. In example above you would enter http://localhost/myscript.dws for the same result.

For debugging read the debug info on http://www.dwscript.com

Sample ISAPI Module

"dwsIsapi.dpr" in subfolgder "dwsIsapi" is a demo project showing how to use DWS in a ISAPI module like we did above.