Top
NetCOBOL V11.0 ISAPI Subroutines User's Guide
FUJITSU Software

D.9 Interface Area with a Server

For a CGI application, you need not be aware in particular of interfaces (except environment variables) with a WWW Server. For an ISAPI application, however, HttpExtensionProc, invoked as a function by IIS, receives an interface (parameter) area to exchange data with IIS. Thus, to convert a CGI application to an ISAPI application, you need to modify the LINKAGE SECTION and the PROCEDURE DIVISION. Since this interface area is used by COBOL ISAPI Subroutines, you need to set the address in COBW3 that is to interface with COBOL ISAPI Subroutines. For example, modify the application as follows:

Return Code

The use of a return code is arbitrary in the main program of a CGI application. However, as described in "Interface Area with a Server", HttpExtensionProc of an ISAPI application is invoked as a function while IIS expects a return value from this function. Thus, for an ISAPI application, you need to set a return code in PROGRAM-STATUS. For example, modify the application as follows:

You can set the following two return codes. Normally, set a normal end. If you set an abnormal end, the WWW Server assumes that an error occurred in the concerned application and sends a corresponding message to the WWW Browser.

Return code

Meaning

1

Normal end

4

Abnormal end