I was able to get it to work, but it took some time to figure it out. Here is a sample program that will demonstrate how to use Perl's SOAP::Lite to talk to Software Planner. Hopefully this will save others from having to go through as much trial and error.
#!/usr/bin/perl
use strict;
use SOAP::Lite;
use Data::Dumper; $Data::Dumper::Indent = 1;
my $proxy = '
http://softwareplanner.mydomain.com/psWS/psWS.asmx';my $uri = '
http://www.pragmaticsw.com';my $xmlschema = '
http://www.w3.org/2001/XMLSchema';sub main {
#########################################################
## Starting up the SWPlanner SOAP Client
#########################################################
print "Starting SWPlanner SOAP Client...\n\n";
# By default SOAP::Lite use [uri]#[method], the .NET
# framework used by SWPlanner requires [uri]/[method]
# This is why the on_action join is required
my $swp = SOAP::Lite
->uri( $uri )
->on_action( sub { join '/', $uri, $_[1] } )
->proxy( $proxy );
$swp->serializer->xmlschema( '
http://www.w3.org/2001/XMLSchema' );
$swp->serializer->soapversion( '1.1' );
$swp->serializer->envprefix( 'soap' );
$swp->serializer->encprefix( 'soapenc' );
#$swp->outputxml( 'true' );
#print Dumper( $services );
#########################################################
## Method requiring no arguments
## Output is in the result
#########################################################
print "Calling GetVersion...\n\n";
my $mname = 'GetVersion';
my $method = SOAP::Data->name( $mname )
->attr( {xmlns => "$uri/" } );
my $som = $swp->call( $method );
print Dumper ( $som->result );
print "\n\n";
#########################################################
## Method requiring multiple arguments
## Output is returned in a data structure
#########################################################
print "Calling GetLoginInfo...\n\n";
my $mname = 'GetLoginInfo';
my $method = SOAP::Data->name( $mname )
->attr( {xmlns => "$uri/" } );
my @params = (
SOAP::Data->name( AppCode => 'agSPEnt' ),
SOAP::Data->name( Email => 'gantry.york@mydomain.com' ),
SOAP::Data->name( Password => 'test123' )
);
my $som = $swp->call( $method => @params );
print Dumper( $som );
my $match_string = "/Enveloper/Body/$mname" . "Response/$mname" . 'Result';
my $data = $som->match( $match_string );
print Dumper( $data->valueof('[1]') );
print Dumper( $data->valueof('[2]') );
print Dumper( $data->valueof('[3]') );
print Dumper( $data->valueof('[4]') );
print Dumper( $data->valueof('[5]') );
print Dumper( $data->valueof('[5]/[1]') );
print "\n\n";
#########################################################
## Method requiring Authentication
## Method requiring complex argument data structure
## output is returned in a data structure
#########################################################
print "Calling Releases_Load...\n\n";
my $mname = 'Releases_Load';
my $method = SOAP::Data->name( $mname )
->attr( {xmlns => "$uri/" } );
# Notice it is PassCode in this method, not Password
my @params = (
SOAP::Data->name( AuthenticationData =>
\SOAP::Data->value(
SOAP::Data->name( AppCode => 'agSPEnt' ),
SOAP::Data->name( DeptId => '8162' ),
SOAP::Data->name( ProjId => '11910' ),
SOAP::Data->name( UserId => '25698' ),
SOAP::Data->name( PassCode => 'test123' ),
SOAP::Data->name( ProjIds =>
\SOAP::Data->value(
SOAP::Data->name( int => '11910' ),
),
),
),
),
SOAP::Data->name( ReleaseId => '10' )
);
my $som = $swp->call( $method => @params );
my $match_string = "/Enveloper/Body/$mname" . "Response/$mname" . 'Result';
my $data = $som->match( $match_string );
print Dumper( $data->valueof('[1]') );
print Dumper( $data->valueof('[2]') );
print Dumper( $data->valueof('[3]') );
print Dumper( $data->valueof('[4]') );
print Dumper( $data->valueof('[5]') );
print Dumper( $data->valueof('[5]/[1]') );
print "\n\n";
}
main();
exit();