script/SOAPsh.pl untested

filter: Statementstmt 0.0% 0 / 25 Branchbran 0.0% 0 / 14 Conditioncond 0.0% 0 / 13 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod n/a totaltotal 0.0% 0 / 55 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/bin/env perl
2 #!d:\perl\bin\perl.exe
3  
4 # -- SOAP::Lite -- soaplite.com -- Copyright (C) 2001 Paul Kulchenko --
5  
6 use strict;
7 use SOAP::Lite;
8 use Data::Dumper; $Data::Dumper::Terse = 1; $Data::Dumper::Indent = 1;
9  
10 @ARGV or die "Usage: $0 proxy [uri [commands...]]\n";
11 my($proxy, $uri) = (shift, shift);
12 my %can;
13 my $soap = SOAP::Lite->proxy($proxy)->on_fault(sub{});
14 $soap->uri($uri) if $uri;
15 print STDERR "Usage: method[(parameters)]\n> ";
16 while (defined($_ = shift || <>)) {
17 next unless /\w/;
18 my($method) = /\s*(\w+)/;
19 $can{$method} = $soap->can($method) unless exists $can{$method};
20 my $res = eval "\$soap->$_";
21 $@ ? print(STDERR join "\n", "--- SYNTAX ERROR ---", $@, '') :
22 $can{$method} && !UNIVERSAL::isa($res => 'SOAP::SOM')
23 ? print(STDERR join "\n", "--- METHOD RESULT ---", $res || '', '') :
24 defined($res) && $res->fault ? print(STDERR join "\n", "--- SOAP FAULT ---", $res->faultcode, $res->faultstring, '') :
25 !$soap->transport->is_success ? print(STDERR join "\n", "--- TRANSPORT ERROR ---", $soap->transport->status, '') :
26 print(STDERR join "\n", "--- SOAP RESULT ---", Dumper($res->paramsall), '')
27 } continue {
28 print STDERR "\n> ";
29 }
30  
31 __END__