Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

SOAP::Lite and web service with http basic auth

by Anonymous Monk
on Oct 18, 2006 at 02:57 UTC ( [id://578945]=perlquestion: print w/replies, xml ) Need Help??

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

I have a piece of code that I used to access web service through https and it worked perfectly.

use strict; use warnings; #use SampleService qw=>(:all); #use SOAP::Lite +trace => qw(all); use SOAP::Lite; #$ENV{HTTPS_DEBUG} = '1'; $ENV{HTTPS_CA_FILE} = 'C:/src/perl/a.cer'; $ENV{HTTPS_CA_DIR} = 'C:/src/perl'; my $lite = new SOAP::Lite( #uri => 'http://org.jboss.ws/samples/docstyle/bare', proxy => 'https://host.company.com:8443/app/services/service?wsdl'); print $lite->getKey()->result;

Recently the web service changed a little bit, and it now uses http basic auth. My question is how can I send the userid/password through ( I do have valid user id and password.) Thanks a lot!

2006-10-18 Retitled by GrandFather, as per Monastery guidelines
Original title: 'SQL::Lite and web service with http basic auth'

Replies are listed 'Best First'.
Re: SOAP::Lite and web service with http basic auth
by chargrill (Parson) on Oct 18, 2006 at 03:11 UTC

    Taken from ~/.cpan/build/SOAP-Lite-0.69/examples/authentication.pl:

    # OR if you have SOAP::Lite object you can do $s->transport->credentials('host_port', 'realm', 'user' => 'password') +; # see LWP::UserAgent for difference and more documentation # OR add user and password to your URL as follows: # proxy => 'http://user:password@localhost/'

    HTH



    --chargrill
    s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-03-19 04:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found