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:
- Your application Id
Note: Applications defined in the GAS configuration file require an
Id attribute. For external configuration files, if the application and the
configuration file share the same name, there is no need to specify the Id
attribute.
- The parent application where the main configuration is set (in this example,
ws.default)
- 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.
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>
- The application inherits the configuration settings of its parent
("ws.default" in this example).
- 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>
- The ALLOW_FROM element specifies from
what hosts access is allowed, the example here is defined in a RESOURCE.
- 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.