http://www.perlmonks.org?node_id=856776


in reply to Convert Perl module to Web Service?

If you want something really simple to expose your module as a Web Service I would use HTTP::Server::Simple::CGI. Note that the vanilla module can only attend one requst at a time, but you also add Net::Server for forking.

I would personally avoid the use of SOAP, XMLRPC and alike. IMHO these protocols add a lot of useless overhead and create all sorts of security issues. Since to properly apply security measures you have to inspect each package and understand it's contents, just to mention one of many flaws.

To expose code correctly over HTTP, I would highly recommend to learn and use HTTP (Representational_State_Transfer) for what it was designed, and map the HTTP semantics to your api, avoiding the use of HTTP as a transport protocol, instead of tranfer.

Basically this boils down to:

If you follow these simple recommendations your Web Services will be secure, simple, elegant, swift, and highly scallable.