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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.