File: stubmaker.pl

package info (click to toggle)
soap-lite 0.55-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,100 kB
  • ctags: 516
  • sloc: perl: 8,038; makefile: 55; cs: 16
file content (27 lines) | stat: -rw-r--r-- 703 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env perl 
#!d:\perl\bin\perl.exe 

# -- SOAP::Lite -- soaplite.com -- Copyright (C) 2001 Paul Kulchenko --

use SOAP::Lite;

print "Accessing...\n";
my $schema = SOAP::Schema
  -> schema(shift or die "Usage: $0 <URL with schema description> [<service> [<port>]]\n")
  -> parse(@ARGV);

print "Writing...\n";
foreach (keys %{$schema->services}) {
  my $file = "./$_.pm";
  print("$file exists, skipped...\n"), next if -s $file;
  open(F, ">$file") or die $!;
  print F $schema->stub($_);
  close(F) or die $!;
  print "$file done\n";
}

# try
# > perl stubmaker.pl http://www.xmethods.net/sd/StockQuoteService.wsdl

# then
# > perl "-MStockQuoteService qw(:all)" -le "print getQuote('MSFT')"