1
0
Fork 0

- GnuviechAdminSOAPServer erweitert den SOAPServer

git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/gnuviech.info/gnuviechadmin/trunk@164 a67ec6bc-e5d5-0310-a910-815c51eb3124
This commit is contained in:
Jan Dittberner 2006-02-21 11:24:41 +00:00
parent c7940b520c
commit e1b3542a2a

View file

@ -7,31 +7,28 @@
from SOAPpy import SOAPServer from SOAPpy import SOAPServer
import logging import logging
class GnuviechAdminSOAPServer: class GnuviechAdminSOAPServer(SOAPServer):
""" """
SOAP Server class for the gnuviech administration tool backend SOAP Server class for the gnuviech administration tool backend
""" """
def echo(self, s): def echo(self, s):
self.logger.debug("calling echo with " + s) self.logger.debug("calling echo with " + s)
#(sock, address) = self.server.get_request()
#self.logger.debug("socket " + sock)
#self.logger.debug("address" + address)
return s + s return s + s
def __init__(self): def __init__(self):
SOAPServer.__init__(self, ("127.0.0.1", 8080))
self.logger = logging.getLogger('GnuviechAdminSOAPServer') self.logger = logging.getLogger('GnuviechAdminSOAPServer')
hdlr = logging.FileHandler('soapserver.log') hdlr = logging.FileHandler('soapserver.log')
hdlr.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s')) hdlr.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s'))
self.logger.addHandler(hdlr) self.logger.addHandler(hdlr)
self.logger.setLevel(logging.DEBUG) self.logger.setLevel(logging.DEBUG)
self.server = SOAPServer(("127.0.0.1", 8080))
self.logger.debug("created SOAPServer") self.logger.debug("created SOAPServer")
self.server.registerFunction(self.echo) self.registerFunction(self.echo)
self.logger.debug("registered function echo") self.logger.debug("registered function echo")
def main(self): def main(self):
self.logger.debug("serving SOAP") self.logger.debug("serving SOAP")
self.server.serve_forever() self.serve_forever()
if __name__ == "__main__": if __name__ == "__main__":
server = GnuviechAdminSOAPServer() server = GnuviechAdminSOAPServer()