/[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

Diff of /trunk/soap.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 38 by dpavlin, Tue May 17 21:37:06 2005 UTC revision 39 by dpavlin, Tue May 17 22:23:40 2005 UTC
# Line 4  Line 4 
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 L<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 => '',
# Line 20  SOAP::Transport::HTTP::CGI Line 26  SOAP::Transport::HTTP::CGI
26          ->dispatch_to('Nos::SOAP')          ->dispatch_to('Nos::SOAP')
27          ->handle;          ->handle;
28    
 package Nos::SOAP;  
   
 =head1 SOAP methods  
   
 This methods are thin wrappers to provide SOAP calls.  
   
 Usually, you want to use named variables in your SOAP calls if at all  
 possible.  
   
 However, if you have broken SOAP library (like PHP SOAP class from PEAR)  
 you will want to use positional arguments (in same order as documented for  
 methods below).  
   
 =head2 NewList  
   
  $message_id = NewList(  
         list => 'My list',  
         email => 'my-list@example.com'  
  );  
   
 =cut  
   
 sub NewList {  
         my $self = shift;  
   
         if ($_[0] !~ m/^HASH/) {  
                 return $nos->new_list(  
                         list => $_[0], email => $_[1],  
                 );  
         } else {  
                 return $nos->new_list( %{ shift @_ } );  
         }  
 }  
   
 =head2 AddMemberToList  
   
  $member_id = AddMemberToList(  
         list => "My list",  
         email => "e-mail@example.com",  
         name => "Full Name"  
  );  
   
 =cut  
   
 sub AddMemberToList {  
         my $self = shift;  
   
         if ($_[0] !~ m/^HASH/) {  
                 return $nos->add_member_to_list(  
                         list => $_[0], email => $_[1], name => $_[2],  
                 );  
         } else {  
                 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;  
   
         if ($_[0] !~ m/^HASH/) {  
                 return $nos->add_message_to_list(  
                         list => $_[0], message => $_[1],  
                 );  
         } else {  
                 return $nos->add_message_to_list( %{ shift @_ } );  
         }  
 }  
   
29  1;  1;

Legend:
Removed from v.38  
changed lines
  Added in v.39

  ViewVC Help
Powered by ViewVC 1.1.26