WebServices ASE
Contents
Installation
Based on an Linux installation using ASE version 15.0.2, here are some steps to install WebServices on an existing database server.
- Run the aseplugin executable (located in $SYBASE/ASEP/bin). Pass the parameter -i for interactive mode (not -I as stated in the Sybase documentation)
- Answer all the questions.
- The script $SYBASE/$SYBASE_WS/bin/installws is loaded into the database server, basically installing the procedures sp_webservices and sp_get_unique_table into the sybsystemprocs database.
- At the end a properties file "ws.properties" is generated in $SYBASE/$SYBASE_WS/props. You can manualy change this file.
- The installation software does not set all non-default configuration values to the value that has been specified during the installation. Check the generated ws.properties file to verify it is correct. A sample is provided here:
com.sybase.ase.ws.name = ASE1_WS com.sybase.ase.ws.producer.httpport = 8181 com.sybase.ase.ws.consumer.cisport = 8183 com.sybase.ase.ws.logfilename = /opt/sybase/admin/ASE1_WS/webservice.log com.sybase.ase.ws.producer.jettylogfile = /opt/sybase/admin/ASE1_WS/http.log com.sybase.ase.ws.interfaces = /opt/sybase/ase1502/interfaces com.sybase.ase.ws.libtcl = /opt/sybase/ase1502/OCS-15_0/config/libtcl.cfg com.sybase.ase.ws.ui.activate = true com.sybase.ase.ws.producer.tuning.maxthreads = 250 com.sybase.ase.ws.producer.tuning.minthreads = 45 com.sybase.ase.ws.producer.tuning.maxidletime = 60000 com.sybase.ase.ws.producer.tuning.ssl.maxthreads = 125 com.sybase.ase.ws.producer.tuning.ssl.minthreads = 10 com.sybase.ase.ws.producer.tuning.ssl.maxidletime = 60000 com.sybase.ase.ws.producer.ssl.password = com.sybase.ase.ws.producer.ssl.httpsport = com.sybase.ase.ws.producer.ssl.keystore = com.sybase.ase.ws.producer.ssl.keypassword =
- Enable web services in ASE by enabling it:
sp_configure "enable webservices",1
Configure WebServices for SSL
When SSL has been configured you can make secure connections and also use your browser for configuration purposes. Configure SSL by running configssl. You are asked to enter 2 passwords. Configssl automatically modifies the ws.properties file to reflect the new settings.
$SYBASE/$SYBASE_WS/bin/configssl -d <hostname>
The ws.properties file now has ssl entries.
com.sybase.ase.ws.producer.ssl.password = F0AA463AB062113FE6376956E2FF2665 com.sybase.ase.ws.producer.ssl.httpsport = 8182 com.sybase.ase.ws.producer.ssl.keystore = /opt/sybase/admin/ASE1_WS/keystore com.sybase.ase.ws.producer.ssl.keypassword = F0AA463AB062113FE6376956E2FF2665
Starting
Start webservices like this:
$SYBASE/$SYBASE_WS/bin/runws -Usa_webservices -P webs01 -SASE1 -f /opt/sybase/admin/ASE1_WS/ASE1_WS.properties
Some notes
- Keep a space between the -P and the actual password.
- The login specified, in this case sa_webservices, should have sa_role.
- Look in the file specified at com.sybase.ase.ws.logfilename if there were any errors during start-up.
Using the GUI to test the setup
When in the ws.properties file com.sybase.ase.ws.ui.activate has been set to true, you can use a browser to access the WebServices server. The URLs that you can use are, for example, http://prd-syb-ase1:8181 and https://prd-syb-ase1:8182. The gui allows you to to view the configuration settings, log files and test web methods. It looks like this:
Using the runexecute client
The runexecute script (located in $SYBASE/$SYBASE_WS/samples/apacheclient) can be used to further test your setup. To run a simple test, like retrieving the @@version global variable from an ASE, do this:
chmod +x $SYBASE/$SYBASE_WS/samples/apacheclient/runexecute $SYBASE/$SYBASE_WS/samples/apacheclient/runexecute "http://prd-syb-ase1:8181/services/ase" ASE1 peter peter01 "header=yes" all 1 "select @@version"
In the Sybase documentation a wrong portnumber is used in combination with the runexecute client, use 8181 in stead of 8183. The output should like like this: runexecute sample output.
Stopping
Stop webservices like this:
$SYBASE/$SYBASE_WS/bin/stopws -Usa_webservices -P webs01 -SASE1 -f /opt/sybase/admin/ASE1_WS/ASE1_WS.properties