Example #1
0
def AsServer(port=80, modules=None, docstyle=1, **kw):
    """ Run as a server """
    address = ('', port)
    httpd = HTTPServer(address, SOAPRequestHandler)
    httpd.modules = modules
    httpd.docstyle = docstyle
    httpd.serve_forever()
Example #2
0
def AsServer(port=80, modules=None, docstyle=0, nsdict={}, typesmodule=None, rpc=None, **kw):
    address = ("", port)
    httpd = HTTPServer(address, SOAPRequestHandler)
    httpd.modules = modules
    httpd.docstyle = docstyle
    httpd.nsdict = nsdict
    httpd.typesmodule = typesmodule
    httpd.rpc = rpc
    httpd.serve_forever()
Example #3
0
def AsServer(port=80,
             modules=None,
             docstyle=False,
             nsdict={},
             typesmodule=None,
             rpc=False,
             addr=''):
    address = (addr, port)
    httpd = HTTPServer(address, SOAPRequestHandler)
    httpd.modules = modules
    httpd.docstyle = docstyle
    httpd.nsdict = nsdict
    httpd.typesmodule = typesmodule
    httpd.rpc = rpc
    httpd.serve_forever()
Example #4
0
if (__name__ == "__main__"):
    # Start server up

    # Parse Config File
    cfgFile = "serverConfig.xml"
    if len(sys.argv) == 2:
        cfgFile = sys.argv[1]
    elif len(sys.argv) > 2:
        print "Usage: " + sys.argv[0] + " [configFile]"
        sys.exit()
        
    if not os.path.exists(cfgFile):
        print "Could not load config file '%s', aborting." % cfgFile
        sys.exit()
    try:
        dom = parse(cfgFile)
    except Exception, err:
        print err
        print "Could not parse config file '%s', aborting." % cfgFile
        sys.exit()

    SRWConfig.buildConfig(SRWConfig, dom.childNodes[0])
    for cfg in SRWConfig.configs:
        SRWConfig.configURLHash[cfg.url] = cfg

    httpd = HTTPServer(('', 8080), SRWRequestHandler)
    httpd.modules = None
    httpd.docstyle = 1
    httpd.serve_forever()