Execution Process of Web App - Talk about WADCGIISAPI

zhaozj2021-02-08  216

The implementation of the web application - Talk about the difference between WAD / CGI / ISAPI Borland provides a variety of web application development in Delphi / C Builder, which is the most commonly used Web App Debugger application (WAD application) ) And CGI / ISAPI running under the Windows / IIS platform. Although in theory, these types of web applications should have no difference in except for the types of Web applications. In general, it can easily change its type, such as: Suppose there is a debug-friendly WAD application, just create a new empty ISAPI app, then add the necessary units in the WAD application to generate a same functionality ISAPI application. But unfortunately, this is not the case, and "C Builder 6 BizSnap (2) - Custom Data Transfer" is released soon, several friends send me Mail to show that they are changed in the text. ISAPI encounters some problems, I found some difference between these types of web applications. That problem is in the database access control and DATAMODULE. In that example, I am putting the data access control in WebModule, which is no problem in WAD, but there is a problem in ISAPI, which is related to the two types of program execution. The other is about DataModule, adding a DATAMODULE in WAD to place the data access control, but the program does not execute in the CGI (ie the prompt or error of the download file), in ISAPI The AV (Access Viocation) error occurs. So this article will look at the differences from the implementation process of these types of web applications. First look at the WAD execution process: Analyze the source of WAD types to know: Each WAD application will create an Automation object with TWebAppAutoBjectFactory, and use getActiveObject when WAD receives a web request to this WAD application. Examples of running, if there is no instance, start one in operation. Once the WAD application instance in the run, the web request is sent through the interface of this Automation object, and the AUTOMATION object calls WebModule to simulate the real web server. The subsequent execution is the necessary process for general web applications. When the Automation object is released (if the reference count is reduced to 0), WebModule is released at the same time. That is, WebModule is available during the entire SOAP request. Take a look at the CGI application: CGI is running separately as a process outside the web server, it is a standard console program, just the web server redirects the web request to the standard input of the CGI program, and the standard input of the CGI program Oriented to the web response. But Borland may have some special practice when compiling, that is, when there is DATAMODULE in the program, it will compile it as a non-web application, so that such a CGI program cannot run in IIS (ie, when entering its URL in the browser, it will appear. Download dialog box). Therefore, you must create DATAMODULE when processing the request.

转载请注明原文地址:https://www.9cbs.com/read-2637.html

New Post(0)