The WebServiceEngine class / com.WebServiceEngine methods |
Get a handle for an incoming HTTP service request.
com.WebServiceEngine.HandleRequest( timeout INTEGER, status INTEGER ) RETURNING result com.HTTPServiceRequest
The com.WebServiceEngine.HandleRequest() class method returns a com.HTTPServiceRequest object to handle an incoming HTTP request, or NULL if there was no request during the given period of time.
The timeout parameter defines the time in seconds to wait for an incoming request. A value of -1 means infinite wait.
If there is no request in the given period of time, or if there is an error, the status code is updated by reference, and a NULL object is returned.
If the request is intended to a registered web service, it is processed automatically. The status code is updated by reference and a NULL object is returned.
If the request isn't dedicated to a registered web service, a status code of value 1 is returned by reference, and a valid instance of an com.HTTPServiceRequest object, immediately usable to handle the incoming request, is returned.
In case of error, the method throws an exception and sets the STATUS variable with the appropriate error number. A human-readable description of the error code is available in the SQLCA.SQLERRM register.
Any new call to this function will raise an error until the previous HTTP request was handled by sending a response back to the client, or destroyed.