home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _eb493f9f7f0548a4e547e14663041f7a < prev    next >
Text File  |  2004-06-01  |  3KB  |  96 lines

  1. @rem = '--*-Perl-*--
  2. @echo off
  3. if "%OS%" == "Windows_NT" goto WinNT
  4. perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
  5. goto endofperl
  6. :WinNT
  7. perl -x -S %0 %*
  8. if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
  9. if %errorlevel% == 9009 echo You do not have Perl in your PATH.
  10. if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
  11. goto endofperl
  12. @rem ';
  13. #!/bin/env perl 
  14. #line 15
  15. #!d:\perl\bin\perl.exe 
  16.  
  17. # -- SOAP::Lite -- soaplite.com -- Copyright (C) 2001 Paul Kulchenko --
  18.  
  19. use strict;
  20. use SOAP::Lite;
  21. use Data::Dumper; $Data::Dumper::Terse = 1; $Data::Dumper::Indent = 1;
  22.  
  23. @ARGV or die "Usage: $0 proxy [uri [commands...]]\n";
  24. my($proxy, $uri) = (shift, shift);
  25. my %can;
  26. my $soap = SOAP::Lite->proxy($proxy)->on_fault(sub{});
  27.                 $soap->uri($uri) if $uri;
  28. print STDERR "Usage: method[(parameters)]\n> ";
  29. while (defined($_ = shift || <>)) {
  30.   next unless /\w/;
  31.   my($method) = /\s*(\w+)/;
  32.   $can{$method} = $soap->can($method) unless exists $can{$method};
  33.   my $res = eval "\$soap->$_";
  34.   $@                               ? print(STDERR join "\n", "--- SYNTAX ERROR ---", $@, '') :
  35.   $can{$method} && !UNIVERSAL::isa($res => 'SOAP::SOM')
  36.                                    ? print(STDERR join "\n", "--- METHOD RESULT ---", $res || '', '') :
  37.   defined($res) && $res->fault     ? print(STDERR join "\n", "--- SOAP FAULT ---", $res->faultcode, $res->faultstring, '') :
  38.   !$soap->transport->is_success    ? print(STDERR join "\n", "--- TRANSPORT ERROR ---", $soap->transport->status, '') :
  39.                                      print(STDERR join "\n", "--- SOAP RESULT ---", Dumper($res->paramsall), '')
  40. } continue {
  41.   print STDERR "\n> ";
  42. }
  43.  
  44. __END__
  45.  
  46. =head1 NAME
  47.  
  48. SOAPsh.pl - Interactive shell for SOAP calls
  49.  
  50. =head1 SYNOPSIS
  51.  
  52.   perl SOAPsh.pl http://services.soaplite.com/examples.cgi http://www.soaplite.com/My/Examples
  53.   > getStateName(2)
  54.   > getStateNames(1,2,3,7)
  55.   > getStateList([1,9])
  56.   > getStateStruct({a=>1, b=>24})
  57.   > Ctrl-D (Ctrl-Z on Windows)
  58.  
  59. or
  60.  
  61.   # all parameters after uri will be executed as methods
  62.   perl SOAPsh.pl http://soap.4s4c.com/ssss4c/soap.asp http://simon.fell.com/calc doubler([10,20,30])
  63.   > Ctrl-D (Ctrl-Z on Windows)
  64.  
  65. =head1 DESCRIPTION
  66.  
  67. SOAPsh.pl is a shell for making SOAP calls. It takes two parameters:
  68. mandatory endpoint and optional uri (actually it will tell you about it 
  69. if you try to run it). Additional commands can follow.
  70.  
  71. After that you'll be able to run any methods of SOAP::Lite, like autotype, 
  72. readable, encoding, etc. You can run it the same way as you do it in 
  73. your Perl script. You'll see output from method, result of SOAP call,
  74. detailed info on SOAP faulure or transport error.
  75.  
  76. For full list of available methods see documentation for SOAP::Lite.
  77.  
  78. Along with methods of SOAP::Lite you'll be able (and that's much more 
  79. interesting) run any SOAP methods you know about on remote server and
  80. see processed results. You can even switch on debugging (with call 
  81. something like: C<on_debug(sub{print@_})>) and see SOAP code with 
  82. headers sent and recieved.
  83.  
  84. =head1 COPYRIGHT
  85.  
  86. Copyright (C) 2000 Paul Kulchenko. All rights reserved.
  87.  
  88. =head1 AUTHOR
  89.  
  90. Paul Kulchenko (paulclinger@yahoo.com)
  91.  
  92. =cut
  93.  
  94. __END__
  95. :endofperl
  96.