Loading ...
Sorry, an error occurred while loading the content.

Basic Authentication with SOAP::Lite

Expand Messages
  • Lina Alshaal
    Hi, I m getting an error when I m trying to use the Authentication Basic in SOAP::Lite. I m using a Soap::Lite based Perl client accessing Apache Axis based on
    Message 1 of 1 , Aug 20, 2003
    • 0 Attachment

      I'm getting an error when I'm trying to use the
      Authentication Basic in SOAP::Lite.
      I'm using a Soap::Lite based Perl client accessing
      Apache Axis based on java service.
      I verified if the LWP::Authen::Basic module is well
      installed as well as other modules.
      I read the http://guide.soaplite.com/ and I tried to
      use all the techniques mentioned in the guide to pass
      the user and password, they don't seem to work!
      Looking at the code, nothing seems to be implemented!

      Here's a part of my perl client code:

      #! /usr/bin/perl -w

      use Data::Dumper;
      use Env;
      use SOAP::Lite +trace => 'debug',
      on_fault => sub { my($soap, $res) = @_;
      eval { die ref $res ?
      $res->faultstring :
      $soap->transport->status };
      return ref $res ? $res : new


      my $soap= SOAP::Lite
      ->proxy($HOST );

      SOAP::Transport::HTTP::Client::get_basic_credentials {
      return 'username' => 'passwd';

      my $som=$soap
      ->sayHello(SOAP::Data->name("" => "$PHRASE"));
      print "The response from the server was: \n"
      .$som->result. "\n";

      Here is a trace fragment for the call from perl
      client: (I used Dumper method in the method
      "send_receive" from /SOAP/Transport/HTTP.pm to dump
      the $req (an instance from the HTTP::Request class) )

      bless( {
      '_method' => 'POST',
      '_headers' => bless( {

      => 'text/xml;

      'content-length' => 560,
      'accept' => [


      'HTTP::Headers' ),
      '_uri' => bless( do{\(my $o =
      'URI::http' ),
      '_content' => '<?xml version="1.0"
      <SOAP-ENV:Body >
      xmlns:namesp1="urn:x-netcelo:webServices.HelloIF" >
      <c-gensym4 xsi:type="xsd:string"


      }, 'HTTP::Request' );

      If we modify SOAP/Transport/HTTP.pm (send_recieve) we
      can explicitly add the basic_authentication header.
      However we have found no correct way of passing the
      authentication parameters with the standard SOAP::Lite
      interface. The "proxy" method accepts parameters that
      are methods from LWP::UserAgent, but they are
      not used....

      What am I missing?
      Thanks for your help..

    Your message has been successfully submitted and would be delivered to recipients shortly.