Alias /perl/ /var/www/perl/
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
Options +ExecCGI
Order allow,deny
Allow from all
####
#!/usr/bin/perl
use strict;
local $SIG{__WARN__}=sub{};
use lib '/home/my_user/lib';
use Getopt::Long;
my $DEBUG;
my $result = GetOptions ("d" => \$DEBUG);
if ($DEBUG) {
eval "use SOAP::Lite +trace => 'debug';";
} else {
eval "use SOAP::Lite;";
}
print SOAP::Lite
-> uri("urn:Hello")
-> proxy('http://my.domain.com/perl/hello.cgi') # mod_perl
# -> proxy('http://my.domain.com/cgi-bin/hello.cgi') # mod_cgi
-> hello()
-> result . "\n";
####
package Hello;
sub hello {
return "hello, world";
}
1;
####
#!/usr/bin/perl
use lib '/home/my_user/lib';
use SOAP::Transport::HTTP;
SOAP::Transport::HTTP::CGI
-> dispatch_to('Hello')
-> handle;
####
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Connection: close
Date: Thu, 30 Sep 2010 22:43:02 GMT
Server: Apache/2.2.3 (Red Hat)
Content-Length: 473
Content-Type: text/xml; charset=utf-8
Client-Date: Thu, 30 Sep 2010 22:43:02 GMT
Client-Peer: 192.168.32.50:80
Client-Response-Num: 1
SOAPServer: SOAP::Litebrerl/0.712
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
hello, world
hello, world