Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 641
Escalation_Dude Avatar asked Sep 09 '14 07:09

Escalation_Dude


1 Answers

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 (e.g., 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 (e.g., mod-php, mod-perl - there the parser is loaded once and just has to execute the requested scripts).

like image 176
MrTux Avatar answered Oct 05 '22 21:10

MrTux