Wiservice

Wiservice

Rôle

WIService is a Python programm binding an http request between a web service server session (IIS, http, …) and a WI.HDL session 1)

Installation

Windows

  • 1. Run the msi provided by Infodata
  • 2. In WIService installation directory, run install-service.bat as an administrator.
  • 3. In Windows services, run “Infodata WIService” and swich Startup type to Automatic.

Linux

  • Check that Python is installed (often under Linux)
  • Copy WIService directory provided by Infodata in another field (/opt is a good option)
  • Create Linux “Service”
    • You can pick-up the example available in “unix” diretory from the previous project
    • The following file explain how to do it README
  • Create Linux “Service”
    • Redhat :
      Installation :
      --------------
      - copy the file unix/WIService in/etc/rc.d/init.d.
      - chkconfig WIService --add
      - chkconfig WIService --list
      WIService       0:off   1:off   2:on    3:on    4:on    5:on    6:off
      
      Use :
      -------------
      - service WIService start
      - service WIService stop
      - service WIService status
      (De)activation au boot :
      -------------------------
      - chkconfig WIService [off|on]
    • Centos :
       Installation :
      --------------
      - copy the file WIservice.service in the directory"/etc/systemd/system"
      - systemctl daemon-reload
      - systemctl enable WIservice
      
      Use: 
      -------------
      - systemctl start WIservice
      - systemctl stop WIservice
      - systemctl status WIservice
      
      (De)activation au boot :
      -------------
      - systemctl enable WIservice
      - systemctl disable WIservice
    • Ubuntu :
      Doc to create a service using upstart : http://upstart.ubuntu.com/getting-started.html. 
      The wiservice service file can be found here : unix/wiservice-ubuntu.conf
  • So necessary, change some service settings directly into the file, so the command line considers characteristics.
  • Start service
    • Copy “%INSTALL_DIR&/unix/WIService” filde under /etc/rc.d/init.d
    • Execute the commands :
      • chkconfig WIService –add : add WIService
      • chkconfig WIService –list : get sure that the service is well added \\
        WIService       0:off   1:off   2:on    3:on    4:on    5:on    6:off
        if "3:on" displays, that means that it will start automaticaly on the boot
      • service WIService start : to start the service
  • You can try it by manually starting wiservice.py. It will attemp to get a status to check that everything is OK.
  • :W: Use the same parameters than in the service above for port communication

Configuration

  • It is possible to change default WIService settings .
    For example, WIService can get to Debug mode. So this will log more informations.
Ini file code Options service linux Description
DEFAULT_PORT -l ou –listening Port number that the server will use to get HTTP requests and transmit them to the DB
Default = 1508
DEFAULT_WI -w ou –wi Port number that the server will use to get connexions from DB
DEFAULT_TIMEOUT -t ou –timeout Server waiting time to get an available handler.
In case of timeout, the request will not succeed ans the WIService returns an error (no handler available).
default = 5 seconds.
DEFAULT_HEARTBEAT -b ou –heartbeat Out of service duration of a service handler.
After this time, a message is sent to extend this duration, otherwise connexion risks to be lost.
Default = 20 seconds
DEFAULT_MAXEXEC -m ou –maxexecute Maximum duration of the requests to the DB.
If processing is too long, an error is sent to the browser.
Default = 60 seconds
DEBUG -d ou –debug Debug mode. If true, no message will be displayed.
Default = False
DEBUG_DEV -D Developer mode. Always stays on False, unless you need to debug WIService program.
Default = False

Windows

  • Under Windows, configuration settings are in wiservice.ini file, in “%ProgramFiles(x86)%\Infodata\WIService” directory
#------------------------------------------------------
# Fichier de config du service windows "WIService"
# si une valeur n'est pas mentionnée ou vide, ce sera
# la valeur par défaut qui sera mentionnée
#------------------------------------------------------
# DEFAULT_PORT      = Port number that the server will use to get
#                     HTTP requests and transmit them to the DB
#                     Default = 1508
# DEFAULT_WI        = Port number that the server will use to get connexions from DB 
#                     Default = 1505
# DEFAULT_TIMEOUT   = Server waiting time to get an available handler. 
#                     In case of timeout, the request will not succeed ans the WIService returns an error.
#                     Default = 5 seconds 
#                     Error message = no handler available 
# DEFAULT_HEARTBEAT = Out of service duration of a service handler. 
#                     After this time, a message is sent to extend this duration, otherwise connexion risks to be lost.
#                     Default = 20 seconds
# DEFAULT_MAXEXEC   = Maximum duration of the requests to the DB. 
#                     If processing is too long, an error is sent to the browser.
#                     Default = 60 seconds
# DEBUG             = Debug mode. If true, no message will be displayed.
#                     Default = False
# DEBUG_DEV         = Developer mode. Always stays on False, unless you need to debug WIService program.
#                     Default = False
#------------------------------------------------------
# Remove # devant la variable pour activer un paramètre
#------------------------------------------------------
#DEFAULT_PORT = 1508
#DEFAULT_WI = 1505
#DEFAULT_TIMEOUT = 5
#DEFAULT_HEARTBEAT = 20 
#DEFAULT_MAXEXEC = 60
#DEBUG = False
#DEBUG_DEV = False

Linux

  • Under Linux : change manually the service file. For example :

Procédure

Check that WIService receives requests

  • Run the following URL on the web server : http://localhost:1508/wiapp. As a result, you will get the following error :
  • The message 'Pool default inconnu“ means that WIService received the request, but no WI-HDL lines are available to process the request.
  • Following message in the file :
Trying to start server on localhost:1508 , wiservice listening on 1505
[Fri Jun 19 15:08:21 2015] ? GET /wiapp : 500 - Erreur de traitement : Pool default inconnu
On the database server, you must open port 1505 in order to let WI.HDL lines on DB Server (Integrix) connect to WIService

Log

In WIService directory, wiservice.log displays the requests processed this day

A line of the log file displays :

  • Date. Date and time of the request.
  • Adresse IP client. IP adress of the computer where the request comes from
  • Web server name.
  • Methode. Request method (GET,POST,PUT,OPTION,….)
  • Url. Request's URL
  • Status. Request's code status.
    • 200. request processing has been successfully completed.
    • 500. Database server Internal error
    • 504. This message appears when no WI.HDL line were available to process the request
    • Please open the following link to know HTTP code list
  • Content-type. Content type sent to the client.
  • Type de message. Two types of message :
    • duration : Duration of the Wiserver to get an aswer to the client
    • Processing error. Happens if WIService didn't get any WI.HDK to process the request
    • attente trop longue. Happens when no WI.HDL line were directly available to process the request
    • Duration. duration (in seconds). The meaning depends on status code. If status code =500, then no duration.
[Fri Jun 19 11:40:35 2015] 192.168.0.82->masterdev GET /dos/AC.TEST&w3hostname=TP&w3exec=ac.ctr : 200 - application/json; charset=UTF-8 , duree: 0.156986 sec
[Fri Jun 19 11:45:22 2015] 192.168.0.97->masterdev GET /dco/3?&w3hostname=TP&w3exec=ac.ctr : 404 - Enregistrement 3 inexistant !
[Fri Jun 19 12:09:41 2015] 192.168.0.79->masterdev GET /gcf?&w3hostname=TP&w3exec=ac.ctr : 504 - attente trop longue : 0.140280 sec
[Fri Jun 19 13:32:22 2015] 192.168.0.82->masterdev POST /dap?&w3hostname=TP&w3exec=ac.ctr : 500 - Erreur de traitement : Erreur lors de la communication avec le Handler Erreur lecture chr(0)
Date Adresse IP client Nom serveur WEB Methode Url Statut Content-type Type de message Durée
[Fri Jun 19 11:40:35 2015] 192.168.0.82 masterdev GET /dos/AC.TEST?&w3hostname=TP&w3exec=ac.ctr 200 application/json; charset=UTF8 duree : 0.156986 sec
[Fri Jun 19 11:45:22 2015] 192.168.0.97 masterdev GET /dco/3?&w3hostname=TP&w3exec=ac.ctr 404 Erreur de traitement Enregistrement 3 inexistant !
[Fri Jun 19 12:09:41 2015] 192.168.0.79 masterdev GET gcf?&w3hostname=TP&w3exec=ac.ctr 504 attente trop longue 0.140280 sec
[Fri Jun 19 13:32:22 2015] 192.168.0.82 masterdev POST /dap?&w3hostname=TP&w3exec=ac.ctr 500 Erreur de traitement Erreur lors de la communication avec le Handler Erreur lecture chr(0)
1)
WI.HDL is a phantom line on DB server, receiving informations from an HTTP request and processing it
public/wi/en/installation/wiservice.txt · Dernière modification: 22/11/2020 09:15 par Jean Christophe Dewalque
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki