The web service simply returns an HTTP status code and some data, possibly serialized in JSON or XML. You can use a module for this CGI, for example:
use strict;
use warnings;
use CGI;
use CGI::Pretty qw/:standard/;
use URI::Escape;
my $query = CGI->new;
my $jsonQueryValue = uri_unescape $query->param('helloWorld');
print header(-type => "application/json", -status => "200 OK");
print "$jsonQueryValue";
, , HTTP- . , - 404, , , . .