5 # XXX: Replace with command line arguments
6 file = '@CONF_DIR@/conf/opensrf_core.xml'
7 method = 'opensrf.simple-text.reverse'
10 # Pull connection settings from <config><opensrf> section of opensrf_core.xml
11 osrf.system.System.connect(config_file=file, config_context='config.opensrf')
13 # Set up a connection to the opensrf.math service
14 session = osrf.ses.ClientSession('opensrf.simple-text')
16 # Call one of the methods defined by the opensrf.math service
17 request = session.request(method, text)
19 # Retrieve the response from the method
20 response = request.recv(timeout=2)
22 print(response.content())
24 # Cleanup request and connection resources