You want to write a web service where SOAP is the transport.
Use the SOAP-Lite distribution from CPAN. Your server can be either standalone:
use SOAP::Transport::HTTP; $daemon = SOAP::Transport::HTTP::Daemon ->new(LocalPort => $PORT) ->dispatch_to('ClassName') ->handle( );
or a CGI script:
use SOAP::Transport::HTTP; $daemon = SOAP::Transport::HTTP::CGI ->dispatch_to('ClassName') ->handle( );
In both cases, the only methods that SOAP clients are permitted to invoke are those in the classes named in the argument to dispatch_to (those classes will be required if not already loaded):
package ClassName; sub handler { my ($class, $arg_hash_ref) = @_; # ... }
The SOAP-Lite toolkit contains SOAP and XML-RPC modules. Writing a SOAP service is similar to writing an XML-RPC service. Control method dispatch in SOAP as in XML-RPC. See Recipe 18.11 for details.
Recipe 18.14; Recipe 18.11