#!/usr/local/perl5/bin/perl use SOAP::Lite+trace => 'all'; $USER = "working_user_name"; $PASS = "working_password"; sub SOAP::Transport::HTTP::Client::get_basic_credentials { print "###\n"; print "###\n"; print "### Authenticating...\n"; print "###\n"; print "###\n"; return $USER => $PASS; } my $soap = SOAP::Lite->new(proxy => 'http://:13080/SM/7/ws'); $soap->default_ns('http://schemas.hp.com/SM/7'); my $som = $soap->call('RetrieveList'); die $som->faultstring if ($som->fault); print $som->result, "\n"; #### #!/usr/local/perl5/bin/perl use SOAP::Lite+trace => 'all'; use LWP::UserAgent; use LWP::Debug; LWP::Debug::level('+'); $USER = "working_user_name"; $PASS = "working_password"; my @ua_args = (keep_alive => 1); my @credentials = ($SERVICE_NS, "", $USER, $PASS); my $schema_ua = LWP::UserAgent->new(@ua_args); $schema_ua->credentials(@credentials); my $soap = SOAP::Lite->new(proxy => 'http://:13080/SM/7/ws', @ua_args, credentials => \@credentials); $soap->default_ns('http://schemas.hp.com/SM/7'); my $som = $soap->call('RetrieveList'); die $som->faultstring if ($som->fault); print $som->result, "\n"; #### #### SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x845c630) SOAP::Transport::HTTP::Client::send_receive: POST http://:13080/SM/7/ws HTTP/1.1 Accept: text/xml Accept: multipart/* Content-Length: 488 Content-Type: text/xml; charset=utf-8 SOAPAction: "#default_ns" http://schemas.hp.com/SM/7 SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x8597238) SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 401 Unauthorized Connection: close Date: Fri, 15 Feb 2013 19:42:06 GMT Server: Apache-Coyote/1.1 WWW-Authenticate: Basic realm="CASM" Content-Length: 40 Content-Type: text/html;charset=utf-8 Client-Date: Fri, 15 Feb 2013 19:42:07 GMT Client-Peer: 134.243.93.19:13080 Client-Response-Num: 1 Not Authorized