Reference / Server API functions - version 1.3 only |
This function waits for an incoming SOAP request for a given time (in seconds) and then processes the request, or returns, if there has been no request during the given time. If a DEFER INTERRUPT or DEFER QUIT instruction has been defined, the function returns even if it is an infinite wait.
FUNCTION fgl_ws_server_process(timeout INTEGER) RETURNING resultStatus INTEGER
DEFER INTERRUPT DEFINE mystatus INTEGER LET mystatus=fgl_ws_server_process(5)# wait for 5 seconds # for incoming request IF mystatus=0 THEN DISPLAY "Request processed." END IF IF mystatus=-1 THEN DISPLAY "No request." END IF IF mystatus=-2 THEN # terminate the application properly EXIT PROGRAM # if connected to application server END IF IF mystatus=-3 THEN DISPLAY "Client connection unexpectedly broken." END IF IF mystatus=-4 THEN DISPLAY "Server process has been interrupted." END IF IF mystatus=-5 THEN DISPLAY "Malformed or bad HTTP request received." END IF IF int_flag<>0 THEN LET int_flag=0 EXIT PROGRAM END IF