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.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|