#!/usr/bin/perl use SOAP::Transport::HTTP; SOAP::Transport::HTTP::CGI->dispatch_to("emailfind")->handle; package emailfind; use HTTP::Cookies; sub findingit { warn "****** findingit(".join(',',map{"'$_'"}@_).")\n"; my $function = shift; my $cookiejar = shift; die "No cookies" unless $cookiejar; my $cookie = $cookiejar->as_string(); die "no cookie" if (!$cookie || $cookie =~ /WALOGIN="RESET/); #exit function if cookie empty or is RESET my ($e) = $cookie =~ /WALOGIN="([^"]+)"/; return $e; } #### #!/usr/bin/perl use warnings; use SOAP::Lite; use HTTP::Cookies; my $cookie = HTTP::Cookies->new(); $cookie->set_cookie(undef,'WALOGIN','foo@bar.com','/','localhost',80,1,1,100,0); my $soap = SOAP::Lite -> uri('http://localhost/emailfind') -> proxy( 'http://localhost/cgi-bin/soapdish2.pl', ); my $res = $soap->findingit($cookie); print $res->result,"\n";