Configure applications for web service

Create an application configuration file (.xcf) for a web services application.

What do you need to configure a Genero web service application? To add an application for a Genero web service, you need to specify:

  • Your application Id

    Applications defined in the GAS configuration file require an Id attribute. For external configuration files, the Id attribute is ignored.

  • The parent application where the main configuration is set (in this example, ws.default)

    The parent referenced must contain the prefix "ws.". For example, these are valid references: Parent="ws.default", Parent="ws.myservice".

  • The path to your compiled files
  • The main module to launch
  • The access control allowing access (optional)
  • The number of DVMs (fglrun) to start for this web service when the GAS starts, and the minimum and maximum number of DVMs allowed.
  • If you are using IIS as your web server, set the COMSPEC environment variable in your web service application configuration file.

    Set the value to what the DOS console returns for "echo %COMSPEC%".

    This variable must be set properly when the gwsproxy starts the fglrun process. You may have this environment variable set by IIS, however situations exist where the setting was not passed on; we ask that you explicitly set it as part of the configuration file for the web service.

These examples show well-formed application configuration for web service applications.

Example: simple web service application

In the following example the configuration is for a web service defined in the GAS configuration file. The PATH is a resource. The path can also be an absolute path to your application files. This configures a GWS server that any web service client can connect to.
  1. The application inherits the configuration settings of its parent ("ws.default" in this example).
  2. The path used in this example references a RESOURCE root for demo applications; you could also use the absolute path pointing to your application files.
<APPLICATION Id="calculator" Parent="ws.default">

When you add an application to the GAS configuration file, you must restart the GAS for the application to be recognized.

Example: web wervice Calculator.xcf

In the following example, if the file was named "Calculator.xcf", then this configuration file would accomplish the same task as when included in the GAS configuration file as in the example in Example: simple web service application. The main differences are the lack of the Id attribute and the addition of the reference to the XML schema.

As a DVM can have several services defined in it, the web Service DVM is an application. The services defined inside are still named service. The published functions are named operations.

  1. The ALLOW_FROM element specifies from what hosts access is allowed, the example here is defined in the res.access.control resource.
  2. The POOL element specifies the number of DVMs to start for this web Service when the GAS starts. In this example zero DVMs at start means the web service is not set to start with the GAS. And the maximum allowed is one DVM.

This example file can be found in $FGLDIR/demo/WebServices. In conjunction with the Example 2: "demo" group defined by resource definition, to access the WSDL of this demo, you can use this kind of URL:


<APPLICATION Parent="ws.default"