Hello all,

The WSDL that I use was enhanced with security. (We're the lowest test environment, so it was inevitable). I had my WSDL connector working like a charm before the "enhancement", but now I am at a loss on how to pass the userID and password via a HTTP header. Here is my code thus far:

#!/usr/bin/perl ############################# # Written By: Frank Friedman # Email: frank.e.friedman@jpmchase.com # Date: Aug. 15, 2012 # Summary: ############################# use Data::Dumper; use SOAP::Lite +trace => 'debug'; #use SOAP::Lite; #use JPMC::PIDM; #use Getopt::Std; #use File::Spec; #use Log::Log4perl qw(get_logger :no_extra_logdie_message); use jpmc_wsdl; #my $proxy = 'http://TEST:testing@myid-dev.company.net/rjam-request-se +rvice/svc/RequestService/3?wsdl'; my $proxy = 'http://myid-dev.company.net/rjam-request-service/svc/Requ +estService/3?wsdl'; my $xmlns = "http://myid.company.net/request/service/3"; my $provider = "homeFolderWin"; my $maxLockedTimes=200; my $startingRecord = "1"; my $recordsToRetrieve = "1"; ## Local variables my $action = "setBestMatch"; my $state = "PLACED"; my $recordCount=0; my $response = fetchandlock({ proxy => $proxy, xmlns => $xmlns, first => $startingRecord, max => $recordsToRetrieve, action => $action, state => $state, }); if($response->fault) { $tmp_string = $response->faultstring(); exit; } #=============================== # Password = test = VEVTVElORzp0ZXN0 # userID = TESTING sub fetchandlock { my $zID="TEST"; my $zPW="VEVTVElORzp2ZXN0"; #base 64 encoding my ($args) = @_; # IIS web services expect / as a separator for uri and method. my $lite = SOAP::Lite->new()->on_action(sub { join '/', @_ } ) ->proxy($args->{proxy}); my $response = $lite->call( SOAP::Data->name('fetchAndLock') ->attr({ 'xmlns', $args->{xmlns}}), SOAP::Data->name("first")->value($args->{first}), SOAP::Data->name("max")->value($args->{max}), SOAP::Data->name("action")->value($args->{action}), SOAP::Data->name("state")->value($args->{state}), ); return $response; }

I can easily connect to the WSDL if I put the userID and password in the proxy (note the commented out "proxy" line near the top).

any insight on how to do it via a SOAP call? I know it goes in my "fetchandLock" subroutine, but where and how do I code it?

any help/insight/suggestions/etc... would be greatly appreciated.

Frank

In reply to soap::lite and authorization by fritz1968

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.