Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > SOAP::Lite - getting WSDL using basic authentication

Reply
Thread Tools

SOAP::Lite - getting WSDL using basic authentication

 
 
J. Gleixner
Guest
Posts: n/a
 
      02-12-2008
I'm trying to find "the" method, using SOAP::Lite or SOAP::Schema,
to get a WSDL that requires HTTP authentication.

The only way I've been able to get a WSDL that requires basic
authentication is by over-riding the SOAP::Schema::access method:

e.g.

use SOAP::Lite;

my $login = 'mylogin';
my $pw = 'mypassword';

my $service = SOAP::Lite
-> service( 'http://some.server.com/some/protected/path/my.wsdl' );
#$service->some_method();

# over-ride method to handle authentication
sub SOAP::Schema::access
{
my $self = shift->new;
my $url = shift || $self->schema_url || Carp::croak 'Nothing to
access. URL is not specified';

my $req = HTTP::Request->new(GET => $url);

# this is why it's over-ridden
$req->authorization_basic($login, $pw);

my $resp = $self->useragent->request($req);
$resp->is_success ? $resp->content : die "Service description '$url'
can't be loaded: ", $resp->status_line, "\n";
}

# and get_basic_credentials for the service calls,
# if they require authentication
sub SOAP::Transport::HTTP::Client::get_basic_credentia ls
{
return $login => $pw;
}



In the Changelog for SOAP::Lite it shows:

0.65-beta2 Mon Oct 25 2004
[...]
+ Added SOAP::Schema->useragent - which returns the LWP::UserAgent
instance that will be used when accessing WSDLs via the
SOAP::Lite->service call. This is helpful when access to a WSDL
requires authentication, etc.

Using S::S->useragent() and the additional LWP methods for
authentication, I can GET the WDSL, however I don't see how that
can be used in SOAP::Schema and by SOAP::Lite without over-riding
the access method. Over-riding it does work, but I'm looking for
how it should be done.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wsdl basic http authentication Vetrivel Vaithilingam Ruby 0 06-02-2010 07:59 AM
webservices, wsdl & xsd (schema-2-wsdl) Dark Java 1 11-14-2008 07:58 PM
SOAPpy and WSDL and basic authentication Vivek Python 0 08-04-2004 12:51 AM
is the w3c's schema for wsdl and wsdl/soap binding possibly buggy ? _clb_ Chris Bedford XML 0 08-20-2003 11:52 PM
WSDL.EXE: WSDL Import Directive Stephen Edgecombe ASP .Net Web Services 0 08-13-2003 06:38 AM



Advertisments