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"; #### xxxxxxxxxx SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK Connection: close Date: Mon, 10 Aug 2009 15:38:43 GMT Server: Apache Content-Length: 622 Content-Type: text/xml; charset=utf-8 Last-Modified: Mon, 10 Aug 2009 15:38:43 GMT Client-Date: Mon, 10 Aug 2009 15:38:43 GMT Client-Peer: 10.22.198.26:80 Client-Response-Num: 1 Set-Cookie: NSAPI=##93D4423CAB0A68B94B6FB6D51F05CF963883EFEC3C958CF6F6DEFA71A008 ;Domain=pns-pfsc-l93a;Path=/soap Status: 200 OK 0Done login: Done SOAP::Transport::HTTP::Client::send_receive: POST http://pns-pfsc-l93a/soap HTTP /1.1 Accept: text/xml Accept: multipart/* Accept: application/soap User-Agent: SOAP::Lite/Perl/0.65_3 Content-Length: 392 Content-Type: text/xml; charset=utf-8; charset=utf-8 SOAPAction: "#logout"