Don't let the name fool you. This isn't a "simplified and feature-limited Perl SOAP module"; It's more like "easy to use and understand SOAP interface."

SOAP::Lite is a module for Perl that provides easy way to implement a server or a client for SOAP (the XML-based protocol for distributed method access). It also has companion modules XMLRPC::Lite and UDDI::Lite for XML-RPC and UDDI, respectively.

The module is, contrary to the name, a whole monster. It appears to work over every protocol known to humankind, not just HTTP...

The distribution even boasts "mod_soap" and Apache::SOAP. Imagine what that would mean to Everything2 client developers!

Home page: http://www.soaplite.com/


Here's a simple example, using CGI.

I made a simple class:

package HelloWorld;

sub new {
  my $obj = {};
  bless $obj;
  return $obj;
}

sub greet {
  my $self = shift;
  my $who = shift;
  return "Hello, $who";
}

1;

And put that to lib/HelloWorld.pm. Then, there's the server part:

#!/usr/bin/perl

use warnings;
use strict;

# Where my module might be?
use lib '/home/wwwwolf/src/kokeilu/soap/lib';

use SOAP::Transport::HTTP;

SOAP::Transport::HTTP::CGI
  ->dispatch_to('/HelloWorld', 'HelloWorld', 'HelloWorld::new')
  ->handle();

...and then I put that to a suitable directory in my web server's directory tree as "soap-hello.cgi". Then, here's a client:

#!/usr/bin/perl

use warnings;
use strict;

use lib '/home/wwwwolf/src/kokeilu/soap/lib';

use SOAP::Lite;
my $result = SOAP::Lite
  -> uri('/HelloWorld')
  -> proxy('http://localhost/test/soap-hello.cgi')
  -> greet("member of the unwashed masses");

die $result->faultstring if($result->fault);

print $result->result, "\n";

...and I ran it:

nighthowl:~/src/kokeilu/soap$ perl hello-client.pl 
Hello, member of the unwashed masses

(More stuff to come as soon as I learn more of the module...)