#!c:\perl\bin\perl.exe
# hello1.pm - simple Hello module
use strict;
sub sayHello {
shift;
return "Hello " . shift;
}
1;
####
#!c:\perl\bin\perl.exe
use lib 'hello1.pm';
# hello.cgi - Hello SOAP handler
print "Content-Type: text/html\n\n";
#my $length = $ENV{'CONTENT_LENGTH'};
#print $length;
#print "hello world";
use SOAP::Transport::HTTP;
SOAP::Transport::HTTP::CGI
-> dispatch_to('hello1::(?:sayHello)')
-> handle
;
####
#!c:\perl\bin\perl.exe
# hw_client.pl - Hello client
use SOAP::Lite;
#use cgi;
use hello1;
#my $cgi_in;
#my $cgi = new CGI ;
#$cgi_in = sayHello($cgi);
#print "Content-Type: text/html\n\n";
#print "Content- Length: 66";
my $name = shift;
#print "$name";
print "\n\nCalling the SOAP Server to say hello\n\n";
print "The SOAP Server says: ";
print SOAP::Lite
-> uri('urn:hello')
-> proxy('http://localhost/cgi-bin/hello.cgi')
-> sayHello($name)
-> result ;
print "welcome";
####
nCalling the SOAP Server to say hello
The SOAP Server says: Hello latha
welcome