http://qs321.pair.com?node_id=561275


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.