Jan Dittberner
979db1b333
- add version and author comment to addpopuser.py - moved db schema description to docs git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/gnuviech.info/gnuviechadmin/trunk@168 a67ec6bc-e5d5-0310-a910-815c51eb3124
46 lines
No EOL
1.3 KiB
Python
46 lines
No EOL
1.3 KiB
Python
#!/usr/bin/python
|
|
#
|
|
# File: soapserver.py
|
|
# (c) 2006 Jan Dittberner <jan@dittberner.info>
|
|
# $Id$
|
|
#
|
|
import SOAPpy
|
|
import logging
|
|
import Settings
|
|
|
|
class SOAPServer(SOAPpy.SOAPServer):
|
|
"""
|
|
SOAP Server class for the gnuviech administration tool backend
|
|
"""
|
|
def echo(self, param0):
|
|
"""
|
|
This method echoes its parameter
|
|
"""
|
|
self.logger.debug("calling echo with " + param0)
|
|
return param0 + param0
|
|
|
|
def __init__(self):
|
|
"""
|
|
This method creates the SOAPServer and registers the methods to be
|
|
available to connected SOAP clients.
|
|
"""
|
|
SOAPpy.SOAPServer.__init__(self, Settings.soapaddress)
|
|
self.logger = logging.getLogger('GnuviechAdminSOAPServer')
|
|
hdlr = logging.FileHandler('soapserver.log')
|
|
hdlr.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s'))
|
|
self.logger.addHandler(hdlr)
|
|
self.logger.setLevel(logging.DEBUG)
|
|
self.logger.debug("created SOAPServer")
|
|
self.registerFunction(self.echo)
|
|
self.logger.debug("registered function echo")
|
|
|
|
def main(self):
|
|
"""
|
|
Starts serving SOAP requests.
|
|
"""
|
|
self.logger.debug("serving SOAP")
|
|
self.serve_forever()
|
|
|
|
if __name__ == "__main__":
|
|
server = SOAPServer()
|
|
server.main() |