Configuring the Uniface Web Application Server

The Uniface Web Application Server (WASV) is automatically configured to work with the default Apache Tomcat web server, so you only need to perform this task if you are creating your own web deployment environment, or customizing the existing configuration.

If you are not using the default Apache Tomcat web server installed with Uniface, you must configure a web server to run the Uniface Java servlets. For more information, see Configure a Web Server for Uniface Applications.

The Uniface Web Application Server consists of a Uniface Server (by default, it is wasv), the Uniface Router, and Uniface Java servlets running in a servlet engine. The WRD servlet handles server page requests in web applications, and the SRD servlet handles SOAP and WSDL requests for web services.

Configuring the WASV is thus largely a matter of configuring these individual components. For example:

  • If you want to secure communication via TLS, you need start the Uniface Router with a TLS port. For more information, see Configure the TLS Connector to Use a Pre-Shared Key.
  • If you want to use a Uniface Server other than wasv, you will need to specify the new server in the urouter.asn file, create an assignment file for it, and edit the MIDDLEWARE servlet settings to call the new server.
  • If you want to fine-tune servlet behavior, you can set optional servlet parameters, not just those defined in the default configuration.
  • If you change the machine hosting your web server, you need to update the MIDDLEWARE servlet parameter.

The following instructions assume the default Tomcat web server. If you are using another web server and servlet engine, refer to the documentation for your preferred web server for details on defining and setting servlet parameters. This may be done in an ASCII file or through a GUI. You can get the values you need to define the servlets in your environment from the web.xml file in UnifaceInstallDir/uniface/webapps/uniface/WEB-INF.

  1. If you are using a Uniface Server other than wasv, specify the Uniface Server Type (UST) for the Uniface Server in your urouter.asn file (in the Uniface/common/adm directory).

    The UST must be the same as the UST defined in the servlet MIDDLEWARE parameter. By default, the installed urouter.asn file specifies the UST wasv, which matches the UST as specified in the servlet MIDDLEWARE parameter.

    For example:

    ; urouter.asn
    [SERVERS]
    wasv = "D:\Uniface\Uniface 10\common\bin\userver.exe" %/
    /dir="D:\Uniface\Uniface 10\common\project" %/
    /adm="D:\Uniface\Uniface 10\uniface\adm" %/
    /asn=wasv.asn
  2. Update the assignment file wasv.asn (in the UnifaceInstallDir/uniface/adm, which corresponds to the UST wasv, with settings for your specific environment.

    By default, this assignment file uses your development environment settings. For testing, the following settings are usually used, but they are normally changed for deployment:

    ; wasv.asn
    [SETTINGS]
    $PUTMESS_LOGFILE = USYSLOG:wasv%p.log
    $TEST_MODE_COMPONENTS
    

    If the setting $CHECK_SIGNATURE_ID is present in your [SETTINGS] section, remove it.

    Note:  When you make changes to assignment files that are used by the Uniface Router or Uniface Server, stop and restart the Uniface Router for those changes to take effect.

  3. Modify the servlet parameters for each servlet.

    In Tomcat, edit the web.xml file.

    For each parameter, define the <param-name> and <param-value> tags within a <init-param> tag. For more information, see Configuration Settings: Uniface Servlet..

    By default, the each servlet is configured to use the local Uniface Router, the local user account userver, and the Uniface Server Type wasv, all installed and configured by the Uniface installer.

    <!-- Uniface WRD Servlet -->
    <servlet>
    <servlet-name>
      wrd
    </servlet-name>
    ...
    <init-param>
    <param-name>MIDDLEWARE</param-name>
    <param-value>UV8:localhost+13001|userver|userver|wasv</param-value>
    </init-param>
    </servlet>
  4. Specify the servlet mapping pattern for each servlet.

    Servlet mappings enable any URL containing a specified pattern to be directed to a specific servlet, without actually knowing the servlet name. For example, the following URL is a request for the WRD servlet to return the server page MYDSP:

    http://localhost:8080/uniface/wrd/mydsp

    The following URL is a request for the SRD servlet to return the WSDL of the service MYSERVICE:

    http://localhost:8080/uniface/services/myservice?wsdl

    For Tomcat, servlet mappings are located near the end of the web.xml file.

    <servlet-mapping>
    <servlet-name>wrd</servlet-name>
    <url-pattern>/wrd/*</url-pattern>
    </servlet-mapping>

    By default, the WRD servlet is mapped to the pattern /wrd/*, and the SRD servlet is mapped to the pattern /services/*.

  5. Stop and restart the web server.
  6. Test the WRD configuration by running a server page component.

    For example, enter the URL of the server page.

    http://localhost:8080/uniface/wrd/mydsp

    Alternatively, if the TESTABLE servlet setting is true, you can enter URL of the Uniface Test Middleware Response page. For more information, see TESTABLE.

  7. Test the SRD configuration by running a Uniface web service.

    For more information, see Constructing Components and Other Objects and Deploying a Uniface Web Service.

Related Topics