|
|
|
@ -4,27 +4,20 @@ from soaplib.service import soapmethod |
|
|
|
class ServidorNFEFalso(SimpleWSGISoapApp): |
|
|
|
from soaplib.serializers.primitive import String, Integer, Array, Null |
|
|
|
|
|
|
|
@soapmethod(_returns=Null) |
|
|
|
def finalizar(self): |
|
|
|
import sys |
|
|
|
sys.exit(0) |
|
|
|
|
|
|
|
@soapmethod(_returns=String) |
|
|
|
def ping(self): |
|
|
|
return 'eu estou aqui' |
|
|
|
@soapmethod(String, Integer, _returns=String) |
|
|
|
def ping(self, palavra, vezes): |
|
|
|
return ','.join([palavra for i in range(vezes)]) |
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
|
porta = 8081 |
|
|
|
porta = 8080 |
|
|
|
|
|
|
|
# Via Tornado |
|
|
|
#import tornado.httpserver |
|
|
|
#import tornado.ioloop |
|
|
|
#http_server = tornado.httpserver.HTTPServer(ServidorNFEFalso()) |
|
|
|
#http_server.listen(porta) |
|
|
|
#tornado.ioloop.IOLoop.instance().start() |
|
|
|
|
|
|
|
# Via CherryPy |
|
|
|
from cherrypy.wsgiserver import CherryPyWSGIServer |
|
|
|
server = CherryPyWSGIServer(('localhost', porta), ServidorNFEFalso()) |
|
|
|
server.start() |
|
|
|
import tornado.wsgi |
|
|
|
import tornado.httpserver |
|
|
|
import tornado.ioloop |
|
|
|
application = ServidorNFEFalso() |
|
|
|
container = tornado.wsgi.WSGIContainer(application) |
|
|
|
http_server = tornado.httpserver.HTTPServer(container) |
|
|
|
http_server.listen(porta) |
|
|
|
tornado.ioloop.IOLoop.instance().start() |
|
|
|
|