Configure a Web service

Create a configuration file with the details the Genero Application Server needs to deliver the Web service to client applications.

The configuration file for a Web services is very similar to that used for applications.

For the purposes of this quick start, you can create a custom configuration file for the Calculator web service located in your $FGLASDIR/demo/WebServices/calculator/ directory.

  1. Create a new directory (for example, you can name it "calculator_config") on your disk where you will store the Calculator web service source files.
  2. Copy all the files from $FGLASDIR/demo/WebServices/calculator/server to your new local directory.
  3. Create a minimal configuration file for your Calculator Web service. Provide a path to the location of your compiled application files in the PATH element, and in the MODULE element specify the module required to launch your Web service.
    Use a text editor or if you are using Studio, go to File >> New >> Web/AS >> Application Configuration (.xcf).
    Note: The Parent attribute reference to ws.default provides default configuration for all applications of the Web service type (see GAS configuration file (as.xcf)).
    <?xml version="1.0" encoding="UTF-8" ?>
    <APPLICATION Parent="ws.default" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:noNamespaceSchemaLocation="http://www.4js.com/ns/gas/3.20/cfextws.xsd">
     <EXECUTION>
       <PATH><path_to_your_local_directory></PATH>
       <MODULE>CalculatorServer.42r</MODULE>
     </EXECUTION>
    </APPLICATION>
  4. To test, save the Web service configuration file in a GAS services group directory.

    You can save the xcf, for example, mycalculator.xcf in the default service group, $(res.appdata.path)/services, directory, or in your own defined group. Alternatively, you can deploy the service.

    You have successfully configured an application.