Jan Dittberner
e1b3542a2a
git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/gnuviech.info/gnuviechadmin/trunk@164 a67ec6bc-e5d5-0310-a910-815c51eb3124
35 lines
No EOL
1.1 KiB
Python
35 lines
No EOL
1.1 KiB
Python
#!/usr/bin/python
|
|
#
|
|
# File: soapserver.py
|
|
# (c) 2006 Jan Dittberner <jan@dittberner.info>
|
|
# $Id$
|
|
#
|
|
from SOAPpy import SOAPServer
|
|
import logging
|
|
|
|
class GnuviechAdminSOAPServer(SOAPServer):
|
|
"""
|
|
SOAP Server class for the gnuviech administration tool backend
|
|
"""
|
|
def echo(self, s):
|
|
self.logger.debug("calling echo with " + s)
|
|
return s + s
|
|
|
|
def __init__(self):
|
|
SOAPServer.__init__(self, ("127.0.0.1", 8080))
|
|
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):
|
|
self.logger.debug("serving SOAP")
|
|
self.serve_forever()
|
|
|
|
if __name__ == "__main__":
|
|
server = GnuviechAdminSOAPServer()
|
|
server.main() |