Writing a Web server application / Example 1: Writing the entire server application |
Once you have registered the Web Service(s), you are ready to start the Genero Web Services (GWS) Server and process the incoming SOAP requests. The GWS Server is located on the same physical machine where the application is being executed (where fglrun is executing).
This is the MAIN program block of your application.
MAIN DEFINE ret INTEGER
CALL createservice()
CALL com.WebServiceEngine.Start()
WHILE TRUE # Process each incoming requests (infinite loop) LET ret = com.WebServiceEngine.ProcessServices(-1) CASE ret WHEN 0 DISPLAY "Request processed." WHEN -1 DISPLAY "Timeout reached." WHEN -2 DISPLAY "Disconnected from application server." EXIT PROGRAM WHEN -3 DISPLAY "Client Connection lost." WHEN -4 DISPLAY "Server interrupted with Ctrl-C." WHEN -10 DISPLAY "Internal server error." END CASE IF int_flag<>0 THEN LET int_flag=0 EXIT WHILE END IF END WHILE DISPLAY "Server stopped" END MAIN