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

WSDL + Basic authentication + SOAP::Lite 0.67?

Expand Messages
  • sqlsoapy
    Is it possible to use SOAP::Lite (0.67) using a service description with a WSDL that requires basic authentication? I can get to work just fine using
    Message 1 of 2 , Jun 22 10:44 AM
    • 0 Attachment
      Is it possible to use SOAP::Lite (0.67) using a service description
      with a WSDL that requires basic authentication? I can get to work
      just fine using 'uri'/'proxy', just not with 'service'.

      Example:
      print SOAP::Lite
      -> service('https://server.comp.com/SQLWS/MyWS?wsdl')
      -> deleteIT('ABC');

      And I followed the directions in SOAP::Transport and added:
      BEGIN {
      sub SOAP::Transport::HTTP::Client::get_basic_credentials {
      return 'username' => 'password';
      }
      }

      But I get the following error: Service description
      'https://server.comp.com/SQLWS/MyWS?wsdl' can't be loaded: 401
      Unauthorized


      But if I rewrite the call like this it works:
      print SOAP::Lite
      -> uri('http://comp.com/SQLWS/MyWS/')
      -> proxy('https://server.comp.com/SQLWS/MyWS')
      -> deleteIT('ABC')
      -> result;
    • retoh123
      A beautiful way is you provide required credentials on client side by overriding function get_basic_credentials() in class SOAP::Transport::HTTP::Client: sub
      Message 2 of 2 , Jun 23 7:57 AM
      • 0 Attachment
        A beautiful way is you provide required credentials on client side
        by overriding function get_basic_credentials() in class
        SOAP::Transport::HTTP::Client:

        sub SOAP::Transport::HTTP::Client::get_basic_credentials {
        return 'youruser' => 'yourpass';
        }

        See an example on
        http://infocopter.com/perl/soap-basic-auth.html

        --reto



        --- In soaplite@yahoogroups.com, "sqlsoapy" <infotbs@...> wrote:
        >
        > Is it possible to use SOAP::Lite (0.67) using a service description
        > with a WSDL that requires basic authentication? I can get to work
        > just fine using 'uri'/'proxy', just not with 'service'.
      Your message has been successfully submitted and would be delivered to recipients shortly.