/[notice-sender]/trunk/soap.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/soap.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 35 - (show annotations)
Tue May 17 15:05:57 2005 UTC (18 years, 11 months ago) by dpavlin
File size: 1640 byte(s)
fix documentation

1 #!/usr/bin/perl -w
2
3 =head1 NAME
4
5 soap.cgi - CGI SOAP interface to notice sender
6
7 =cut
8
9 use strict;
10 use Nos;
11
12 my $nos = new Nos(
13 dsn => 'dbi:Pg:dbname=notices',
14 user => 'dpavlin',
15 passwd => '',
16 );
17
18 use SOAP::Transport::HTTP +trace => 'debug';
19 SOAP::Transport::HTTP::CGI
20 ->dispatch_to('Nos::SOAP')
21 ->handle;
22
23 package Nos::SOAP;
24
25 =head1 SOAP methods
26
27 This methods are thin wrappers to provide SOAP calls.
28
29 Usually, you want to use named variables in your SOAP calls if at all
30 possible.
31
32 However, if you have broken SOAP library (like PHP SOAP class from PEAR)
33 you will want to use positional arguments (in same order as documented for
34 methods below).
35
36 =head2 NewList
37
38 $message_id = NewList(
39 list => 'My list',
40 email => 'my-list@example.com'
41 );
42
43 =cut
44
45 sub NewList {
46 my $self = shift;
47
48 if ($_[0] !~ m/^HASH/) {
49 return $nos->new_list(
50 list => $_[0], email => $_[1],
51 );
52 } else {
53 return $nos->new_list( %{ shift @_ } );
54 }
55 }
56
57 =head2 AddMemberToList
58
59 $member_id = AddMemberToList(
60 list => "My list",
61 email => "e-mail@example.com",
62 name => "Full Name"
63 );
64
65 =cut
66
67 sub AddMemberToList {
68 my $self = shift;
69
70 if ($_[0] !~ m/^HASH/) {
71 return $nos->add_member_to_list(
72 list => $_[0], email => $_[1], name => $_[2],
73 );
74 } else {
75 return $nos->add_member_to_list( %{ shift @_ } );
76 }
77 }
78
79 =head2 AddMessageToList
80
81 $message_id = AddMessageToList(
82 list => 'My list',
83 message => 'From: My list...'
84 );
85
86 =cut
87
88 sub AddMessageToList {
89 my $self = shift;
90
91 if ($_[0] !~ m/^HASH/) {
92 return $nos->add_message_to_list(
93 list => $_[0], message => $_[1],
94 );
95 } else {
96 return $nos->add_message_to_list( %{ shift @_ } );
97 }
98 }
99

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26