# # main # opt = parse_args() if opt.url.startswith('https://'): sec_lv = 1 sec_lv = opt.sec_lv url, host = set_default_port(opt.url) #soapGetAddressLocation(opt.wsdl) # # parse the configuration file if specified. # cf = fiapConfig.fiapConfig(opt.cfile, security_level=sec_lv, debug=opt.debug) if opt.debug: print 'DEBUG: reading request file.' if opt.bfile != None: fp = open(opt.bfile) else: fp = sys.stdin src = fp.read() if src == None: print 'ERROR: src document is nothing' exit(1) fiap = fiapProto.fiapProto(cf, debug=opt.debug) #
p.add_argument('-p', action='store', dest='port', default=None, help='specify the port number for this server.') p.add_argument('-s', action='store', dest='sec_lv', default=0, help='specify to use TLS connection. 0, 1, or 2') p.add_argument('-c', action='store', dest='cfile', default=False, help='specify the file name of the configuration.') p.add_argument('-z', action='store', dest='tzname', default='Asia/Tokyo', help='specify the name of default timezone. ') p.add_argument('-d', action='store', dest='debug', default=0, help='specify the debug level. 0, 1, or 2') opt = p.parse_args() return opt # # main # opt = parse_args() cf = fiapConfig.fiapConfig(opt.cfile, security_level=opt.sec_lv, tzname=opt.tzname, debug=opt.debug) # # set the runner and default port if needed. # if opt.sec_lv: if opt.port == None: opt.port = 18883 else: if opt.port == None: opt.port = 18880 run(port=opt.port, config=cf)