4 |
|
|
5 |
soap.cgi - CGI SOAP interface to notice sender |
soap.cgi - CGI SOAP interface to notice sender |
6 |
|
|
7 |
|
=head1 DESCRIPTION |
8 |
|
|
9 |
|
Provide example SOAP service using CGI script. |
10 |
|
|
11 |
|
Available methods are in C<Nos::SOAP> package, see C<Nos>. |
12 |
|
|
13 |
=cut |
=cut |
14 |
|
|
15 |
use strict; |
use strict; |
16 |
use Nos; |
use Nos; |
17 |
|
|
18 |
my $nos = new Nos( |
my $nos = new Nos::SOAP( |
19 |
dsn => 'dbi:Pg:dbname=notices', |
dsn => 'dbi:Pg:dbname=notices', |
20 |
user => 'dpavlin', |
user => 'dpavlin', |
21 |
passwd => '', |
passwd => '', |
26 |
->dispatch_to('Nos::SOAP') |
->dispatch_to('Nos::SOAP') |
27 |
->handle; |
->handle; |
28 |
|
|
29 |
package Nos::SOAP; |
1; |
|
|
|
|
=head1 SOAP methods |
|
|
|
|
|
This methods are thin wrappers to provide SOAP calls. |
|
|
|
|
|
=head2 AddMemberToList |
|
|
|
|
|
$member_id = AddMemberToList( |
|
|
list => "My list", |
|
|
email => "e-mail@example.com", |
|
|
name => "Full Name" |
|
|
); |
|
|
|
|
|
=cut |
|
|
|
|
|
sub AddMemberToList { |
|
|
my $self = shift; |
|
|
|
|
|
return $nos->add_member_to_list( %{ shift @_ } ); |
|
|
} |
|
|
|
|
|
=head2 AddMessageToList |
|
|
|
|
|
$message_id = AddMessageToList( |
|
|
list => 'My list', |
|
|
message => 'From: My list...' |
|
|
); |
|
|
|
|
|
=cut |
|
|
|
|
|
sub AddMessageToList { |
|
|
my $self = shift; |
|
|
|
|
|
return $nos->add_message_to_list( %{ shift @_ } ); |
|
|
} |
|
|
|
|