in reply to Authentication and Authorization for SOAP

You can pass the username and password as parameters in your request, like
my $result = SOAP::Lite -> uri('http://www.example.com/Protected') -> proxy('http://www.example.com/soap.cgi') -> fetchdata($name, $pass, @request) -> result;
And define the fetchdata method at server-side as smth like this (i didn't add SOAP-specific code, but it can be taken directly from SOAP::Lite docs):
package Protected; sub fetchdata { my $pkg = shift; my $name = shift; my $pass = shift; #check the $name and $pass and process @request # or send an response indicating authentication error }

I have no experience in Java, but as i can see, the code sample you showed seems to do the same thing, but sends only name and password.

Replies are listed 'Best First'.
Re^2: Authentication and Authorization for SOAP
by rob_au (Abbot) on Jul 14, 2006 at 17:32 UTC
Re^2: Authentication and Authorization for SOAP
by duckyd (Hermit) on Jul 14, 2006 at 20:37 UTC
    A common practice is to pass authentication information in the SOAP headers. With SOAP::Lite, you can do this by creating SOAP::Header objects (just like SOAP::Data, but they'll be placed in the header):
    my $headers = SOAP::Header ->name( 'LoginCredentials' ) ->value( [ SOAP::Header ->name('Username') ->value( $username ) , SOAP::Header ->name('Password') ->value( $password ) , ] ) ) ;
    The login credentials can then be passed along with any other arguments into whatever SOAP method is being called, and dealt with seperately.