With the SOAP call in better shape, I had to work around an issue with the Username and Password being in the wrong order (the WSDL specifies them as a sequence).

I think I just have one more hurdle to overcome. The current version of the script results in the SOAP body:

<soap:Body> <DirList xmlns="Test_Module" xsi:nil="true" /> </soap:Body>

But in order to work it seems that it should be:

<soap:Body> <tra:DirList /> </soap:Body>

(Where tra is a namespace defined as "Test_Module"). Additionally, I'll want to add a couple of parameters like so:

<soap:Body> <tra:DirList> <param1>value1</param1> <param2>value2</param2> </tra:DirList> </soap:Body>

My recent attempts at adding the parameters have resulted in lots of c-gensym tags added, which I think is an indication that I'm not referencing the data correctly

The code as it currently stands (without the attempt at adding parameters):

#!/usr/bin/perl -w use strict; use SOAP::Lite +trace => 'debug', maptype => { }; use Tie::IxHash; my $userId = "admin"; my $password = "adminpw"; my %authHash; tie %authHash, "Tie::IxHash"; %authHash = ( Username => SOAP::Data->type( '' => $userId )->prefix('wss +e'), Password => SOAP::Data->type( '' => $password )->prefix('w +sse'), ); my $wsdl = "http://10.50.50.132:9080/ws/workflow"; my $rba = SOAP::Lite->uri('Test_Module')->proxy($wsdl); $rba->on_action(sub { return '"execute-workflow"'; } ); my $wsse = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-ws +security-secext-1.0.xsd"; my $gridName = SOAP::Header->new( name => 'grid-name', value => 'Amsterdam', uri => 'urn:realops.com:amp:workflow', prefix => '', type => '', ); my $securityHeader = SOAP::Header->new( name => 'Security', uri => $wsse, prefix => 'wsse', value => \SOAP::Data->new( name => 'UsernameToken', prefix => 'wsse', value => \%authHash ) ); my $result = $rba->DirList($gridName, $securityHeader)->result(); print "\n\n\n$result\n";

In reply to Re^2: Setting XML prefix for tags with SOAP::Lite by TheFluffyOne
in thread Setting XML prefix for tags with SOAP::Lite by TheFluffyOne

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.