#! /usr/bin/perl
use strict;
use SOAP::Transport::HTTP;
SOAP::Transport::HTTP::CGI
-> dispatch_to( '/var/www/localhost/cgi-bin/soap_modules' )
-> handle;
####
#! /usr/bin/perl -w
use strict;
use SOAP::Lite;
my $soap = SOAP::Lite
-> proxy( 'http://dg.example.org/cgi-bin/soapserver.cgi' )
-> uri( 'http://dg.example.org/Greeter' )
-> on_fault( sub { my($soap, $res) = @_;
die ref $res ? $res->faultstring : $soap->transport->status, "\n";
});
my $greeter = $soap->call( new => 'Doug' )->result;
print $soap->formal( $greeter )->result;
__END__
##
##
package Greeter;
use strict;
use warnings;
sub new {
my $self = shift;
bless { name => shift }, 'Greeter';
}
sub formal {
my $self = shift;
return "Welcome, $self->{name}.";
}
sub casual {
my $self = shift;
return "Howdy, $self->{name}!";
}
1;
##
##
Denied access to method (formal) in class (Greeter) at /usr/lib/perl5/site_perl/5.8.2/SOAP/Lite.pm line 2267.