About

Introduction

The HUGIN Web Service API is the HUGIN decision engine turned into a RESTful web service.  It is, in fact, a mash-up of several distinct features:

Summary
AboutThe HUGIN Web Service API is the HUGIN decision engine turned into a RESTful web service.
Server ProcessThe HUGIN decision engine lives in the server process.
LicenseHUGIN Web Service API, JavaScript for HUGIN Web Service API, HUGIN Widgets Library, HUGIN JavaScript RPC Runtime and the HUGIN decision engine are copyright HUGIN EXPERT A/S.

Server Process

The HUGIN decision engine lives in the server process.  All inference is done in the server which responds to requests using the well-known HTTP protocol (served by builtin Jetty HTTP server).

Dependencies: The server is implemented in Java and depends on the Hugin Java API.  Java 8 or better is required.

Starting Server

To start the Server Process, run huginws.jar using Java

java -classpath huginws.jar;<PATH-hapi.jar> -Djava.library.path=<PATH-.dll/.so-DIR> COM.hugin.WEBSERVICE.Main [options...]
<PATH-hapi.jar>must be the path to a HUGIN Java API JAR-file (make sure you reference the correct HAPI.jar-files for 32-bit or 64-bit Java)
<PATH-.dll/.so-DIR>must be the path to the directory where Java can find the hapi.dll/libhapi.dll-file.
[options...]specify any options for the Server Process.

Options

Options are specified on the command line as key = value pairs, or optionally in a configuration file.  Available options are:

portthe port number for the web server (defualt is port=8080).
configfileload a configuration file containing additional options (file follows the .properties file format).
verbosewhether or not to enable verbose logging (default is verbose=false) - mainly for debugging purposes.
seconds-timeout-to-reclaimnumber of seconds a domain resource can remain untouched before it (and all its sub-resources) are eligible for garbage collection (default is seconds-timeout-to-reclaim=240).
seconds-between-status-reportsoutput some usage statistics at this interval (default is seconds-between-status-reports=3600).
hostsif specified, server is only allowed to connect to specific hosts for performing IO operations (loading .hkb/data, saving data).  A comma-separated list of hostnames.  E.g.  hosts=”myhost1.com,myhost2.com”
disable-*disable invocation of specific HUGIN function over HTTP - use it for limiting the server to fit your requirements.  Substitute * with the name of the function that should be disabled.  E.g. to disable invocation of the <DomainResource -> /getNewNode> function specify option disable-getNewNode=1
rpcwhether to enable builtin remote procedure calling features and allow server side evaluation of javascript code (default is rpc=false).
rpc-seconds-max-executionset the maximum time server side javascript code is allowed execute before being interrupted (default is rpc-seconds-max-execution=30).
The HUGIN Web Service API exposes a RESTful HTTP interface for interacting with the HUGIN decision engine.
The JavaScript for HUGIN Web Service API provides a scripting interface to the HUGIN Web Service API for using HUGIN in a browser context.
The HUGIN Widgets Library is a tool-box of UI elements for exercising the Javascript for HUGIN Web services API through point-and-click on a web page.
The Server Process hosts a JavaScript runtime (currently a Mozilla Rhino implementation) capable of loading scripts and exercising HUGIN and script objects.
The HUGIN decision engine lives in the server process.
Close