The Simple Object Access Protocol (SOAP, also known as Service Oriented Access Protocol) is a way to remotely make method calls upon classes and objects that exist on a remote server.
The SOAP::Lite collection of Perl modules provides a simple and lightweight interface to SOAP.
Emerge SOAP::Lite
emerge search soap
emerge -f SOAP-Lite
emerge SOAP-Lite
The downloaded components are:
libnet-1.16.tar.gz, MailTools-1.60.tar.gz, MIME-Base64-3.00.tar.gz, IO-stringy-2.108.tar.gz,
Digest-1.05.tar.gz, Digest-MD5-2.33.tar.gz, Crypt-SSLeay-0.49.tar.gz, URI-1.28.tar.gz, HTML-Tagset-3.03.tar.gz,
HTML-Parser-3.28.tar.gz, libwww-perl-5.69.tar.gz, MIME-tools-5.411a.tar.gz, MIME-Lite-3.01.tar.gz, SOAP-Lite-0.55.tar.gz
SOAP is based on the HTTP protocol. You will need to have a running HTTP server on the SOAP server machine.
Writing a SOAP server CGI is described in SOAP Quick Start Guide.
Let's take the hiBye example:
#!perl -w
# -- SOAP::Lite -- guide.soaplite.com -- Copyright (C) 2001 Paul Kulchenko --
use SOAP::Transport::HTTP;
SOAP::Transport::HTTP::CGI
-> dispatch_to('Demo')
-> handle;
package Demo;
sub hi {
return "hello, world";
}
sub bye {
return "goodbye, cruel world";
}
sub languages {
return ("Perl", "C", "sh");
}
Save this file on your server as hiBye.pl.
Make sure the directory it is installed in is served by the HTTP server.
The SOAP client is:
#!perl -w
use SOAP::Lite;
print SOAP::Lite
-> uri('http://www.soaplite.com/Demo')
-> proxy('http://serverAddress/serverPath/hiBye.pl')
-> hi()
-> result;
Save this file on your server as HiBye.pl.
Make sure the directory it is installed in is served by the HTTP server.