Ejemplo n.º 1
0
class SOAPRepositoryServer(RepositoryServer):

    def __init__(self, repository, host='localhost', port=8080):

        super(SOAPRepositoryServer, self).__init__(repository)

        self.server = SOAPServer((host, port), encoding='utf-8')
        self.server.registerObject(self)

    def startup(self):

        self.server.serve_forever()
Ejemplo n.º 2
0
 def run(self):
     """Ejecucion del demonio"""
     sms = sms()
     server = SOAPServer(("localhost", self._port))
     server.registerFunction(sms.sms_send)
     server.registerFunction(sms.info_cel)
     while True:
         try:
             server.serve_forever()
             logger.info("sms daemond started")
         except KeyboardInterrupt:
             logger.info("sms daemond ended")
             exit()
         time.sleep(self._pidfile_timeout)
Ejemplo n.º 3
0
 def run(self):
     """Ejecucion del demonio"""
     cell = Cell()
     server = SOAPServer(("localhost",8580))
     server.registerFunction(cell.detectar_dispositivos)
     server.registerFunction(cell.listar_forwarding)
     server.registerFunction(cell.remover_forwarding)
     server.registerFunction(cell.agregar_forwarding)
     server.registerFunction(cell.detener_servicio)
     server.registerFunction(cell.iniciar_servicio)
     server.registerFunction(cell.port)
     while True:
         try:
             cell.config_file = configfile         
             server.serve_forever()
             logger.info("deviceCelldaemond started")
         except KeyboardInterrupt:
             logger.info("deviceCelldaemond ended")
             exit()
         time.sleep(self._pidfile_timeout)
Ejemplo n.º 4
0
 def run(self):
     """Ejecucion del demonio"""
     cell = Cell()
     server = SOAPServer(("localhost", 8580))
     server.registerFunction(cell.detectar_dispositivos)
     server.registerFunction(cell.listar_forwarding)
     server.registerFunction(cell.remover_forwarding)
     server.registerFunction(cell.agregar_forwarding)
     server.registerFunction(cell.detener_servicio)
     server.registerFunction(cell.iniciar_servicio)
     server.registerFunction(cell.port)
     while True:
         try:
             cell.config_file = configfile
             server.serve_forever()
             logger.info("deviceCelldaemond started")
         except KeyboardInterrupt:
             logger.info("deviceCelldaemond ended")
             exit()
         time.sleep(self._pidfile_timeout)
Ejemplo n.º 5
0
def createjob(ticketid, comando):

def calcula(op1,op2,operacao):
        id = createticketid()

        return createticketid()
        op1 = randint(5,90)
        time.sleep(30)
        if operacao == '+':
                return op1 + op2
        if operacao == '-':
                return op1 - op2
        if operacao == '*':
                return op1 * op2
        if operacao == '/':
                return op1 / op2

server = SOAPServer(('localhost',8081))
server.registerFunction(calcula,"ns-calcula","calcula")
server.config.dumpSOAPOut = 1
server.config.dumpSOAPIn = 1
server.serve_forever()
Ejemplo n.º 6
0
#!/usr/bin/env python2.4

import sys
from SOAPpy import SOAPServer

WS_NS = 'http://frade.no-ip.info/wsFOAF'


class foafWS:
    def test(self):
        return "Cadena de prueba"

    def getFoaf(self, chain):
        return "http://www.wikier.org/foaf.rdf"


server = SOAPServer(('', 8880))
ws = foafWS()

server.registerObject(ws, WS_NS)

print "Starting server..."
server.serve_forever()
Ejemplo n.º 7
0
#coding: utf-8

from SOAPpy import SOAPServer


def calcula(op1, op2, operacao):
    if operacao == '+':
        return op1 + op2
    if operacao == '-':
        return op1 - op2
    if operacao == '*':
        return op1 * op2
    if operacao == '/':
        return op1 / op2


server = SOAPServer(('localhost', 8081))
server.registerFunction(calcula)
server.serve_forever()  #processa uma ou várias solicitações.
Ejemplo n.º 8
0
#encoding:utf-8

from SOAPpy import SOAPServer
from Funcionario import Funcionario

func = Funcionario("funcionarios.txt")

srv = SOAPServer(("localhost",8087))
srv.registerFunction(func.cadastrarFuncionario)
srv.registerFunction(func.consultarFuncionario)
srv.registerFunction(func.deletarFuncionario)
srv.serve_forever()