示例#1
0
def main(argv):
    from twisted.python import log
    from twisted.web.server import Site
    from twisted.web.static import File
    from twisted.internet import reactor
    from twisted.python import log

    observer = log.PythonLoggingObserver('twisted')
    log.startLoggingWithObserver(observer.emit, setStdout=False)

    static_dir = os.path.abspath('.')
    logging.info("registering static folder %r on /" % static_dir)
    root = File(static_dir)

    wr = TwistedWebResource(soap11_application)
    logging.info("registering %r on /%s" % (wr, url))
    root.putChild(url, wr)

    site = Site(root)

    if port[0] == 0:
        port[0] = get_open_port()
    reactor.listenTCP(port[0], site)
    logging.info("listening on: %s:%d" % (host,port))

    return reactor.run()
示例#2
0
def main():
    try:
        from wsgiref.simple_server import make_server
        from wsgiref.validate import validator
        if port[0] == 0:
            port[0] = get_open_port()

        wsgi_application = WsgiApplication(soap11_application)
        server = make_server(host, port[0], validator(wsgi_application))

        logger.info('Starting interop server at %s:%s.' % ('0.0.0.0', port[0]))
        logger.info('WSDL is at: /?wsdl')
        server.serve_forever()

    except ImportError:
        print("Error: example server code requires Python >= 2.5")
示例#3
0
def main():
    try:
        from wsgiref.simple_server import make_server
        from wsgiref.validate import validator
        if port[0] == 0:
            port[0] = get_open_port()

        wsgi_application = WsgiApplication(soap11_application)
        server = make_server(host, port[0], validator(wsgi_application))

        logger.info('Starting interop server at %s:%s.' % ('0.0.0.0', port[0]))
        logger.info('WSDL is at: /?wsdl')
        server.serve_forever()

    except ImportError:
        print("Error: example server code requires Python >= 2.5")
def main(argv):
    from twisted.web.server import Site
    from twisted.internet import reactor
    from twisted.python import log

    observer = log.PythonLoggingObserver('twisted')
    log.startLoggingWithObserver(observer.emit, setStdout=False)

    wr = TwistedWebResource(soap11_application)
    site = Site(wr)

    if port[0] == 0:
        port[0] = get_open_port()
    reactor.listenTCP(port[0], site)
    logging.info("listening on: %s:%d" % (host, port[0]))

    return reactor.run()
示例#5
0
def main():
    if port[0] == 0:
        port[0] = get_open_port()
    url = "tcp://%s:%d" % (host, port[0])

    logging.basicConfig(level=logging.DEBUG)
    logging.getLogger('spyne.protocol.xml').setLevel(logging.DEBUG)

    server = ZeroMQServer(soap11_application, url)
    logging.info("************************")
    logging.info("Use Ctrl+\\ to exit if Ctrl-C does not work.")
    logging.info("See the 'I can't Ctrl-C my Python/Ruby application. Help!' "
                 "question in http://www.zeromq.org/area:faq for more info.")
    logging.info("listening on %r" % url)
    logging.info("************************")

    server.serve_forever()
示例#6
0
文件: soap_zeromq.py 项目: plq/spyne
def main():
    if port[0] == 0:
        port[0] = get_open_port()
    url = "tcp://%s:%d" % (host, port[0])

    logging.basicConfig(level=logging.DEBUG)
    logging.getLogger('spyne.protocol.xml').setLevel(logging.DEBUG)

    server = ZeroMQServer(soap11_application, url)
    logging.info("************************")
    logging.info("Use Ctrl+\\ to exit if Ctrl-C does not work.")
    logging.info("See the 'I can't Ctrl-C my Python/Ruby application. Help!' "
                 "question in http://www.zeromq.org/area:faq for more info.")
    logging.info("listening on %r" % url)
    logging.info("************************")

    server.serve_forever()
示例#7
0
def main(argv):
    from twisted.web.server import Site
    from twisted.internet import reactor
    from twisted.python import log
    observer = log.PythonLoggingObserver('twisted')
    log.startLoggingWithObserver(observer.emit, setStdout=False)

    if port[0] == 0:
        port[0] = get_open_port()

    wr = TwistedWebResource(httprpc_soap_application)
    site = Site(wr)

    reactor.listenTCP(port[0], site)
    logging.info("listening on: %s:%d" % (host,port[0]))

    return reactor.run()
示例#8
0
from spyne.protocol.csv import OutCsv
from spyne.protocol.http import HttpRpc
from spyne.server.wsgi import WsgiApplication
from spyne.test.interop.server._service import services

httprpc_csv_application = Application(services,
        'spyne.test.interop.server.httprpc.csv', in_protocol=HttpRpc(), out_protocol=OutCsv())


host = '127.0.0.1'
port = [0]


if __name__ == '__main__':
    try:
        from wsgiref.simple_server import make_server
        from wsgiref.validate import validator

        if port[0] == 0:
            port[0] = get_open_port()

        wsgi_application = WsgiApplication(httprpc_csv_application)
        server = make_server(host, port[0], validator(wsgi_application))

        logger.info('Starting interop server at %s:%s.' % ('0.0.0.0', port[0]))
        logger.info('WSDL is at: /?wsdl')
        server.serve_forever()

    except ImportError:
        print("Error: example server code requires Python >= 2.5")
示例#9
0
from spyne.protocol.http import HttpRpc
from spyne.protocol.soap import Soap11
from spyne.server.wsgi import WsgiApplication
from spyne.test.interop.server import get_open_port


httprpc_soap_application = Application(services,
    'spyne.test.interop.server.httprpc.soap', in_protocol=HttpRpc(), out_protocol=Soap11())


host = '127.0.0.1'
port = [0]


if __name__ == '__main__':
    try:
        from wsgiref.simple_server import make_server
        from wsgiref.validate import validator
        if port[0] == 0:
            port[0] = get_open_port()

        wsgi_application = WsgiApplication(httprpc_soap_application)
        server = make_server(host, port[0], validator(wsgi_application))

        logger.info('Starting interop server at %s:%s.' % ('0.0.0.0', port[0]))
        logger.info('WSDL is at: /?wsdl')
        server.serve_forever()

    except ImportError:
        print("Error: example server code requires Python >= 2.5")