com.WebServiceEngine.ProcessServices
Wait for an HTTP input request to process an operation of one of the registered SOAP or REST Web Services.
Syntax
com.WebServiceEngine.ProcessServices(
timeout INTEGER )
RETURNS INTEGER
- timeout defines the timeout in seconds.
Usage
The com.WebServiceEngine.ProcessServices() method
processes requests made by client apps for operations of a SOAP or REST web service registered by
the Genero Web Service engine. Typically, you call the method inside a WHILE loop
to process the various requests and control the workflow for all requests made by clients. As long
as the int_flag variable is
FALSE or the execution status is valid, the condition within the
loop remains TRUE and requests are executed.
For a complete example of Web service execution and status handling, see Process requests.
The timeout parameter defines the wait period (in seconds) the method may wait to process a request. The value -1 specifies an infinite waiting time.
The status returned by the method provides information about the execution of the last web operation. A return status of zero means OK. For a complete list of error codes, see Error codes of com.WebServicesEngineThe execution status is typically handled in a
CASE / END CASE block, to treat all possible execution cases.
A status of -8 or -10 is returned if an invalid or unsupported HTTP request is sent.
This is not an issue in production environments as the Genero Application Server (GAS) and GWSProxy will detect the ended DVM, return an HTTP error code to the client app, and any new request will start a new DVM in a clean state via GWS proxy and the pool configuration.
If the com.WebServiceEngine.Flush() method is used, the return status handling
must be done in the web operation function, while
com.WebServiceEngine.ProcessServices() will return the code -31, to indicated that a flush was done.
Example: Handle HTTP requests
com.WebServiceEngine.ProcessServices() to
handle web service execution and status handling, go to Process requests.When you need to intercept and respond to unregistered services or implement custom endpoints,
use com.WebServiceEngine.HandleRequest instead of
com.WebServiceEngine.ProcessServices()