Previous Section  < Day Day Up >  Next Section

Hack 93. Install the SOAP::Lite Perl Module

Install the SOAP::Lite Perl module, backbone of the vast majority of hacks in this book.

The SOAP::Lite ( Perl module is the de facto standard for interfacing with SOAP-based web services from Perl. As such, it is used extensively throughout this book and in hacks that you might stumble across online.

While teaching you how to install Perl modules is beyond the scope of this book, we've included these instructions to bootstrap your Google hacking without need of wandering off in search of a Perl book.

It's unfortunately rather common for Internet service providers (ISPs) not to make SOAP::Lite available to their users. In many cases, ISPs are rather restrictive in general about what modules they make available and scripts they allow users to execute. Others are more accommodating and more than willing to install Perl modules on request. Before taking up your time and brainpower installing SOAP::Lite yourself, ask your service provider if it's already there or if it can be installed for you.

Probably the easiest way to install SOAP::Lite is via another Perl module, CPAN, included with just about every modern Perl distribution. The CPAN module automates the installation of Perl modules, fetching components and any prerequisites from the Comprehensive Perl Archive Network (thus the name, CPAN) and building the whole kit-and-kaboodle on the fly.

CPAN installs modules into standard system-wide locations and, therefore, assumes you're running as the root user. If you have no more than regular user access, you'll have to install SOAP::Lite and its prerequisites by hand ["Unix Installaion by Hand" in the next section].

9.10.1. Unix and Mac OS X Installation via CPAN

Assuming you have the CPAN module, have root access, and are connected to the Internet, installation should be no more complicated than:

% su


# perl -MCPAN -e shell

cpan shell -- CPAN exploration and modules installation (v1.52)

ReadLine support available (try ``install Bundle::CPAN'')

cpan> install SOAP::Lite

Or, if you prefer one-liners:

% sudo perl -MCPAN -e 'install SOAP::Lite'

In either case, go grab yourself a cup of coffee, meander the garden, read the paper, and check back once in a while. Your terminal's sure to be riddled with incomprehensible gobbledygook that you can, for the most part, summarily ignore. You may be asked a question or three; in most cases, simply hitting return to accept the default answer will do the trick.

9.10.2. Unix Installation by Hand

If CPAN installation didn't quite work as expected, you can of course install SOAP::Lite by hand. Download the latest version from (, unpack, and build it like so:

% tar xvzf SOAP-Lite-latest.tar.gz






% cd SOAP-Lite-


% perl Makefile.PL

We are about to install SOAP::Lite and for your convenience will 

provide you with list of modules and prerequisites, so you'll be able 

to choose only modules you need for your configuration.

XMLRPC::Lite, UDDI::Lite, and XML::Parser::Lite are included by default.

Installed transports can be used for both SOAP::Lite and XMLRPC::Lite.

Client HTTP support (SOAP::Transport::HTTP::Client)        [yes]

Client HTTPS support (SOAP::Transport::HTTPS::Client...    [no]


SSL support for TCP transport (SOAP::Transport::TCP)       [no]

Compression support for HTTP transport (SOAP::Transport... [no]

Do you want to proceed with this configuration? [yes] 

During "make test" phase we may run tests with several SOAP servers 

that may take long and may fail due to server/connectivity problems. 

Do you want to perform these tests in addition to core tests? [no] 

Checking if your kit is complete...

Looks good


% make

mkdir blib

mkdir blib/lib


% make test

PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib

-I/System/Library/Perl/darwin -I/System/Library/Perl -e 'use

Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;'

t/01-core.t t/02-payload.t t/03-server.t t/04-attach.t t/05-customxml.t

t/06-modules.t t/07-xmlrpc_payload.t t/08-schema.t t/01-core...........


# sudo make install


Installing /Library/Perl/XMLRPC/

Installing /Library/Perl/XMLRPC/


If, during the perl Makefile.PL phase, you run into any warnings about installing prerequisites, install each in turn before attempting to install SOAP::Lite again. A typical prerequisite warning looks something like this:

Checking if your kit is complete...

Looks good


prerequisite HTTP::Daemon

 failed to load: Can't locate

HTTP/ in @INC (@INC contains: /System/Library/Perl/darwin

/System/Library/Perl /Library/Perl/darwin /Library/Perl /Library/Perl

/Network/Library/Perl/darwin /Network/Library/Perl

/Network/Library/Perl .) at (eval 8) line 3.

If you have little more than user access to the system and still insist on installing SOAP::Lite yourself, you'll have to install it and all its prerequisites somewhere in your home directory. ~/lib, a lib directory in your home directory, is as good a place as any. Inform Perl of your preference like so:

% perl Makefile.PL LIB=


Replace /home/login/lib with an appropriate path.

9.10.3. Windows Installation via PPM

If you're running Perl under Windows, chances are its ActiveState's ActivePerl ( Thankfully, ActivePerl's outfitted with a CPAN-like module installation utility. The Programmer's Package Manager (PPM, grabs nicely packaged module bundles from the ActiveState archive and drops them into place on your Windows system with little need of help from you.

Simply launch PPM from inside a DOS terminal window and tell it to install the SOAP::Lite bundle.


PPM interactive shell (2.1.6) - type 'help' for available commands.

PPM> install SOAP::Lite

If you're running a reasonably recent build, you're probably in for a pleasant surprise:


PPM interactive shell (2.1.6) - type 'help' for available commands.

PPM> install SOAP::Lite

Version 0.55 of 'SOAP-Lite' is already installed.

9.10.4. A Note About Expat

There's a little something called Expat ( that, more often than not, is the one hiccup in the installation process—particularly when installing using the CPAN module or by hand. Expat is an XML parser library written in the C programming language and underlying many of the XML modules that you might use. Fortunately, you'll probably find it installed by default on the system you're using, but if it isn't there, you won't get very far.

The easiest way to install Expat under Mac OS X or Unix/Linux goes a little something like this:

$ curl -O X.XX.X


$ tar -xvzf xpat- X.XX.X



$ cd expat-


$ ./configure

$ make

$ sudo make install

    Previous Section  < Day Day Up >  Next Section