1 |
#!/usr/bin/perl -w |
#!/usr/bin/perl -w |
2 |
|
|
3 |
use SOAP::Lite; # +trace => 'debug'; |
use SOAP::Lite; |
4 |
|
use Data::Dumper; |
5 |
|
|
6 |
|
my $debug = 0; |
7 |
|
$debug = 1 if (@ARGV); |
8 |
|
|
9 |
my $HOST = "http://localhost/~dpavlin/notice-sender/soap.cgi"; |
my $HOST = "http://localhost/~dpavlin/notice-sender/soap.cgi"; |
10 |
my $NS = "http://localhost/Nos/SOAP/"; |
my $NS = "http://localhost/Nos/SOAP/"; |
11 |
my $soap = SOAP::Lite |
my $soap = SOAP::Lite |
13 |
->uri($NS) |
->uri($NS) |
14 |
->proxy($HOST); |
->proxy($HOST); |
15 |
|
|
16 |
|
$soap->on_debug(sub{print "# ",@_}) if ($debug); |
17 |
|
|
18 |
my $list_id = $soap->NewList({ |
my $list_id = $soap->CreateList({ |
19 |
list => 'My list', |
list => 'My list', |
20 |
email => 'my-soap@example.com', |
email => 'my-soap@example.com', |
21 |
})->result || die "can't add list"; |
})->result || die "can't add list"; |
55 |
print "\t",$m->{'email'},"\n"; |
print "\t",$m->{'email'},"\n"; |
56 |
} |
} |
57 |
|
|
58 |
|
my @r = $soap->MessagesReceived({ |
59 |
|
list => 'My list', |
60 |
|
})->result; |
61 |
|
print "received messages: ", Dumper(\@r); |
62 |
|
|
63 |
$soap->DeleteMemberFromList({ |
$soap->DeleteMemberFromList({ |
64 |
list => 'My list', |
list => 'My list', |
65 |
email => 'dpavlin@rot13.org', |
email => 'dpavlin@rot13.org', |
67 |
|
|
68 |
print "deleted member\n"; |
print "deleted member\n"; |
69 |
|
|
70 |
|
$soap->DropList({ |
71 |
|
list => 'My list' |
72 |
|
}); |
73 |
|
|
74 |
|
print "delete list\n"; |
75 |
|
|
76 |
1; |
1; |