http://www.perlmonks.org?node_id=1045943

skunix has asked for the wisdom of the Perl Monks concerning the following question:

Solved!
I'm not sure why the syntax below doesn't work but to fix it I put the username and password in the proxy URL like so...

https://<user>:<pass>@<host>:<port>/<path>

I am trying to use SOAP::Lite to connect to a SOAP api that requires HTTP auth but I can't seem to get it to work and I have no idea how to debug this!

This is what I'm trying to do...

#!/usr/bin/perl use strict; use SOAP::Lite; my $soap = SOAP::Lite->new( proxy => [ 'https://<host>:<port>/<path>', 'credentails' => [ '<host>:<port>', # host:port 'My Realm', # realm 'username', 'password' ] ] ); my $som = $soap->RetrieveList(); die $som->faultstring if ($som->fault); print $som->results, "\n";

This is what I get for output...

401 Unauthorized at test.pl line 25.

The documentation, if you can call it that, for SOAP::Lite has been of no help. Anyone know what I am doing wrong?

$~=$^++;_:$~^=$^ ^=$~^=$^;$_.=($~=$~+$^.$/);($~<$$)?goto _:print