in reply to Re: Setting XML prefix for tags with SOAP::Lite
in thread Setting XML prefix for tags with SOAP::Lite
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Setting XML prefix for tags with SOAP::Lite
by TheFluffyOne (Beadle) on Jul 31, 2008 at 21:56 UTC | |
by TheFluffyOne (Beadle) on Aug 01, 2008 at 09:34 UTC |