Ejemplo n.º 1
0
You can use relative paths too, e.g. if you are calling the above database from the same directory, 
the connection string can just be:

swis_connection_string = 'sqlite:///swis2.db' 
'''

LCM_connection_string = 'sqlite:///LCM_Data/LCM.db'

dao = LCMDao(LCM_connection_string,'LCM_config.cfg')
LCM_wof = WOF(dao)
LCM_wof.config_from_file('LCM_config.cfg')

app = create_app(LCM_wof)
app.config.from_object(config.DevConfig)

ODMWOFService = create_wof_service_class(LCM_wof)

soap_app = soaplib.core.Application(services=[ODMWOFService],
                                    tns='http://www.cuahsi.org/his/1.0/ws/',
                                    name='WaterOneFlow')

soap_wsgi_app = soaplib.core.server.wsgi.Application(soap_app)

app.wsgi_app = DispatcherMiddleware(app.wsgi_app, {
     '/soap/wateroneflow': soap_wsgi_app,   
    })

if __name__ == '__main__':
    # This must be an available port on your computer.  
    # For example, if 8080 is already being used, try another port such as
    # 5000 or 8081.
Ejemplo n.º 2
0
You can use relative paths too, e.g. if you are calling the above database from the same directory, 
the connection string can just be:

swis_connection_string = 'sqlite:///swis2.db' 
'''

LCM_connection_string = 'sqlite:///LCM_Data/LCM.db'

dao = LCMDao(LCM_connection_string, 'LCM_config.cfg')
LCM_wof = WOF(dao)
LCM_wof.config_from_file('LCM_config.cfg')

app = create_app(LCM_wof)
app.config.from_object(config.DevConfig)

ODMWOFService = create_wof_service_class(LCM_wof)

soap_app = soaplib.core.Application(services=[ODMWOFService],
                                    tns='http://www.cuahsi.org/his/1.0/ws/',
                                    name='WaterOneFlow')

soap_wsgi_app = soaplib.core.server.wsgi.Application(soap_app)

app.wsgi_app = DispatcherMiddleware(app.wsgi_app, {
    '/soap/wateroneflow': soap_wsgi_app,
})

if __name__ == '__main__':
    # This must be an available port on your computer.
    # For example, if 8080 is already being used, try another port such as
    # 5000 or 8081.
Ejemplo n.º 3
0
swis_dao = SwisDao('swis/swis_config.cfg',
                   database_uri='sqlite:///swis/swis2.db')
lcm_dao = LCMDao('sqlite:///barebones/LCM_Data/LCM.db',
                 'barebones/LCM_config.cfg')

swis_wof = WOF(swis_dao)
swis_wof.config_from_file('swis/swis_config.cfg')

lcm_wof = WOF(lcm_dao)
lcm_wof.config_from_file('barebones/LCM_config.cfg')
#Create the Flask applications
swis_flask_app = create_app(swis_wof)
lcm_flask_app = create_app(lcm_wof)

#Create the soaplib classes
SWISWOFService = create_wof_service_class(swis_wof)
LCMWOFService = create_wof_service_class(lcm_wof)

#Create the soaplib applications
swis_soap_app = soaplib.core.Application(services=[SWISWOFService],
    tns='http://www.cuahsi.org/his/1.0/ws/',
    name='WaterOneFlow')

lcm_soap_app = soaplib.core.Application(services=[LCMWOFService],
    tns='http://www.cuahsi.org/his/1.0/ws/',
    name='WaterOneFlow')

#Create WSGI apps from the soaplib applications
swis_soap_wsgi_app = soaplib.core.server.wsgi.Application(swis_soap_app)
lcm_soap_wsgi_app = soaplib.core.server.wsgi.Application(lcm_soap_app)
Ejemplo n.º 4
0
swis_dao = SwisDao('swis/swis_config.cfg',
                   database_uri='sqlite:///swis/swis2.db')
lcm_dao = LCMDao('sqlite:///barebones/LCM_Data/LCM.db',
                 'barebones/LCM_config.cfg')

swis_wof = WOF(swis_dao)
swis_wof.config_from_file('swis/swis_config.cfg')

lcm_wof = WOF(lcm_dao)
lcm_wof.config_from_file('barebones/LCM_config.cfg')
#Create the Flask applications
swis_flask_app = create_app(swis_wof)
lcm_flask_app = create_app(lcm_wof)

#Create the soaplib classes
SWISWOFService = create_wof_service_class(swis_wof)
LCMWOFService = create_wof_service_class(lcm_wof)

#Create the soaplib applications
swis_soap_app = soaplib.core.Application(
    services=[SWISWOFService],
    tns='http://www.cuahsi.org/his/1.0/ws/',
    name='WaterOneFlow')

lcm_soap_app = soaplib.core.Application(
    services=[LCMWOFService],
    tns='http://www.cuahsi.org/his/1.0/ws/',
    name='WaterOneFlow')

#Create WSGI apps from the soaplib applications
swis_soap_wsgi_app = soaplib.core.server.wsgi.Application(swis_soap_app)