Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
3.2 KiB

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