Configure applications for Web service

Create a separate application configuration (xcf) file for each 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:

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.

<APPLICATION Id="calculator" Parent="ws.default">
  <EXECUTION>
    <PATH>$(res.path.fgldir.demo)/WebServices/calculator/server</PATH>
    <MODULE>calculatorServer</MODULE>
  </EXECUTION>
</APPLICATION>
  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 name leading to your application files.

Example: Web Service 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 reference to the XML schema.
Note: Because 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.
<APPLICATION Parent="ws.default"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="http://www.4js.com/ns/gas/3.00/cfextws.xsd">
  <EXECUTION>
    <PATH>$(res.path.fgldir.demo)/WebServices/calculator/server</PATH>
    <MODULE>calculatorServer</MODULE>
    <ACCESS_CONTROL>
        <ALLOW_FROM>$(res.access.control)</ALLOW_FROM>
    </ACCESS_CONTROL>
    <POOL>
        <START>0</START>
        <MIN_AVAILABLE>0</MIN_AVAILABLE>
        <MAX_AVAILABLE>1</MAX_AVAILABLE>
    </POOL>
  </EXECUTION>
</APPLICATION>
  1. The ALLOW_FROM element specifies from what hosts access is allowed, the example here is defined in a 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:

http://appserver:6394/ws/r/demo/calculator?WSDL

See Web services URI information.