Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

SOAP::Lite - 401 Unauthorized

by skunix (Novice)
on Jul 23, 2013 at 19:45 UTC ( #1045943=perlquestion: print w/ replies, xml ) Need Help??
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

Comment on SOAP::Lite - 401 Unauthorized
Select or Download Code
Re: SOAP::Lite - 401 Unauthorized
by Loops (Curate) on Jul 23, 2013 at 19:57 UTC

    If you have access to the server logs they'll likely reveal what the failure is. Short of that, you can inspect what is actually going out over the wire by tracing transport events using SOAP::Trace.

Re: SOAP::Lite - 401 Unauthorized
by poj (Priest) on Jul 23, 2013 at 20:47 UTC
    Try 'credentials' not 'credentails'.
    Poj

      Darn my dyslexia, still having the same issue but at least that's fixed!

      $~=$^++;_:$~^=$^ ^=$~^=$^;$_.=($~=$~+$^.$/);($~<$$)?goto _:print
Re: SOAP::Lite - 401 Unauthorized
by vsespb (Hermit) on Jul 23, 2013 at 23:36 UTC
    Today new version of SOAP::Lite released

    so possible it introduced new bug (and you use new version), either it fixed old bug (and you use old version)

      I am using the latest version. I tried installing version 0.716, no luck.

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1045943]
Approved by hdb
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2014-12-27 17:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls