1 |
#!/usr/bin/perl -w |
#!/usr/bin/perl -w |
2 |
|
|
3 |
use SOAP::Lite; # +trace => 'debug'; |
use SOAP::Lite; |
4 |
|
|
5 |
|
my $debug = 0; |
6 |
|
$debug = 1 if (@ARGV); |
7 |
|
|
8 |
my $HOST = "http://localhost/~dpavlin/notice-sender/soap.cgi"; |
my $HOST = "http://localhost/~dpavlin/notice-sender/soap.cgi"; |
9 |
my $NS = "http://localhost/Nos/SOAP/"; |
my $NS = "http://localhost/Nos/SOAP/"; |
10 |
my $soap = SOAP::Lite |
my $soap = SOAP::Lite |
12 |
->uri($NS) |
->uri($NS) |
13 |
->proxy($HOST); |
->proxy($HOST); |
14 |
|
|
15 |
|
$soap->on_debug(sub{print "# ",@_}) if ($debug); |
16 |
|
|
17 |
my $list_id = $soap->NewList({ |
my $list_id = $soap->NewList({ |
18 |
list => 'My list', |
list => 'My list', |
43 |
|
|
44 |
print "added message ID $message_id\n"; |
print "added message ID $message_id\n"; |
45 |
|
|
46 |
|
my $result = $soap->ListMembers({ |
47 |
|
list => 'My list', |
48 |
|
}); |
49 |
|
|
50 |
|
die "can't list members ".$result->faultcode.": ".$result->faultstrig if ($result->fault); |
51 |
|
|
52 |
|
print "members:\n"; |
53 |
|
foreach my $m (@{$result->result}) { |
54 |
|
print "\t",$m->{'email'},"\n"; |
55 |
|
} |
56 |
|
|
57 |
|
$soap->DeleteMemberFromList({ |
58 |
|
list => 'My list', |
59 |
|
email => 'dpavlin@rot13.org', |
60 |
|
})->result || die "can't delete member"; |
61 |
|
|
62 |
|
print "deleted member\n"; |
63 |
|
|
64 |
|
$soap->DeleteList({ |
65 |
|
list => 'My list' |
66 |
|
}); |
67 |
|
|
68 |
|
print "delete list\n"; |
69 |
|
|
70 |
1; |
1; |