简体   繁体   中英

difference between cgi and webservice

Can any one tell me the main differences between CGI application and webservice. I have been googling but could not found any better answers.

I just know that CGI was found earlier than webservice.

CGI (Common Gateway Interface) is a way for webservers to start external applications (and pass reuqest information to the application) in order to provide dynamic contents.

A webservice is also some kind of dynamic content and can be implemented using CGI applications (or similar methods). However, for webservices the content is machine readable (XML) and has to follow a strict specification. Thus, webservices aim for being used automatically by other programs.

The general idea of CGI is still used today, however, it has some drawbacks (eg, for every request a new application has to be started on the server). Nowadays it's more common to have modules/plugins loaded into the webserver which handle the execution of scripts (eg, mod-php, mod-perl - there the parser is loaded once and just has to execute the requested scripts).

CGI vs. Web Server APIs The Common Gateway Interface (CGI) was introduced as a standard protocol for extending the functionality of Web servers with additional applications. Most CGI applications are simple executables that are launched every time they are requested. ColdFusion uses a more robust architecture. The ColdFusion Application Server runs as a multi-threaded system service and handles all of the complicated processing. The Application Server communicates with the Web server either through a very small CGI executable referred to as the stub (cfml.exe) or through a native Web server API.

As Web servers have developed, each vendor has introduced and implemented an application programming interface (API) for their server. The native Web server APIs offer additional features and significantly increased performance. Instead of launching a CGI executable, servers supporting an API communicate directly with the ColdFusion application server through a DLL.

In addition to introducing server APIs, many server vendors have created document type mapping, so that individual document extensions can be associated with a process. This makes it possible to create ColdFusion application pages that are stored directly in the Web server's root directory.

ColdFusion supports the following major native Web server APIs:

  • Netscape API (NSAPI)
  • Internet Server
  • API (ISAPI)
  • Website API (WSAPI)
  • Apache API

These APIs and document type mapping are supported by these servers:

  • Netscape Enterprise and FastTrack Servers
  • Microsoft IIS (all versions)
  • WebSite (1.1 and Pro)
  • Apache
  • List item

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM