Configure service to start when GAS starts
You can configure your web service to start when the dispatcher starts.
The example application configuration file illustrates how to configure a service to start when
the GAS starts. The
POOL element is configured to manage the service as follows:- By setting the
STARTelement value to 1, the service will start automatically when the dispatcher starts. - By setting the
MIN_AVAILABLEelement value to 0, the GAS will stop the DVM if idle for a given period of time; otherwise, the DVM will continue to run until you stop the GAS.
For more information on how the GAS manages the POOL, go to Services Pool (GWS Only).
The path to the module points to the directory where the service xcf is;
therefore, the URL to access the service will depend on its location:
- Typically, if you deploy your service on the GAS, the xcf will be in the
default appdata directory for services, and the URL to access the service will
be:
http://host:port/ws/r/myxcf/myservice
- If your xcf is somewhere else, you must configure the
GROUPresource in the GAS configuration file (as.xcf), and then the URL to access the service must include the group id:http://host:port/ws/r/mygroup/myxcf/myservice
For different examples of accessing web services, go to URI examples, and for more information on creating groups, go to Create application/service group.
ENVIRONMENT_VARIABLE for debugging is optional.Example: Start service when GAS dispatcher starts
<APPLICATION Parent="ws.default">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.4js.com/ns/gas/5.01/cfextws.xsd">
<EXECUTION>
<ENVIRONMENT_VARIABLE Id="FGLWSDEBUG">0</ENVIRONMENT_VARIABLE>
<PATH>app_path</PATH>
<MODULE>myservice.42r</MODULE>
<ACCESS_CONTROL>
<ALLOW_FROM>$(res.access.control)</ALLOW_FROM>
</ACCESS_CONTROL>
<POOL>
<START>1</START>
<MIN_AVAILABLE>0</MIN_AVAILABLE>
<MAX_AVAILABLE>1</MAX_AVAILABLE>
</POOL>
</EXECUTION>
</APPLICATION>