use SOAP::Lite +trace=>"debug"; # troubleshoot: append: +trace=>"debug"; import SOAP::Data 'name'; # to set data values (q.v.) use HTTP::Cookies; # server uses client cookie for auth use Data::Dumper; # Command-line parameters: my $NS = shift @ARGV; $NS = "localhost" if (!$NS); my $username = shift @ARGV; $username = "xxxxx" if (!$username); my $password = shift @ARGV; $password = "xxxxx" if (!$password); # Cookie object. Server sends cookie for client authentication. my $cookies = HTTP::Cookies->new(ignore_discard => 1, hide_cookie2 => 1); # Create the soap object my $soap = SOAP::Lite # service URI and cookie object -> proxy("http://$NS/soap", cookie_jar=>$cookies) ; # Log on print "login: "; my $result = $soap->login( name('username'=>$username), name('password'=>$password) ) ->result; print $result->{'message'} . "\n"; # Logout print "logout: "; $result = $soap->logout()->result; print $result->{'message'} . "\n";