stevewong Posted October 16, 2020 Share Posted October 16, 2020 Hi, I was going to make a sign in with google button to my login form. I then get into trouble. My problem is : I was not able to issue RESTFUL call under windows IIS hyper server environment. I have attached my code, it is a copy from the demo login form, when the user click login, it will do a REST request to a website to get something. The program work perfectly OK when I run it as a standalone exe. But when I deploy is to the hyper server, the program got an exception : Signin_App.exe: 00001530: 10:26:48 [TUniServerModule]:Server First Init. Signin_App.exe: 00001530: 10:26:48 [TUniServerModule]:Node Id = 2 Signin_App.exe: 00001530: 10:26:48 [TUniServerModule]:Node MaxSessions = 250 Signin_App.exe: 00001530: 10:26:48 [TUniServerModule]:Starting HTTP Server on Port: 19686... Signin_App.exe: 00001530: 10:26:48 [TUniServerModule]:HTTP Server Started on Port: 19686 Signin_App.exe: 000022B8: 10:26:49 [172.16.2.18]:ENetHTTPClientException : Error obtaining session handle : Addr: $00A0BB16 Signin_App.exe: 0000222C: 10:27:46 []:Node-2, Terminate Started. Signin_App.exe: 00001530: 10:27:47 [TUniServerModule]:Shutting Down Server. Signin_App.exe: 00001530: 10:27:47 [TUniServerModule]:Stopping HTTP Server. Signin_App.exe: 00001530: 10:27:47 [TUniServerModule]:HTTP Server Stopped. Signin_App.exe: 00001530: 10:27:47 [TUniGUISessionManager]:Terminating Session manager. Signin_App.exe: 00001530: 10:27:47 [TUniGUISessionManager]:Stopping Cache Eraser... Signin_App.exe: 00001530: 10:27:47 [TUniGUISessionManager]:Cache Eraser Stopped. Signin_App.exe: 00001530: 10:27:47 [TUniGUISessionManager]:Destroying Worker Threads. Signin_App.exe: 00001530: 10:27:47 [TUniGUISessionManager]:Session manager terminated. Signin_App.exe: 00001530: 10:27:48 [TUniServerModule]:Server Shutdown Completed. Can anyone help me to solve this ? LoginForm.zip Quote Link to comment Share on other sites More sharing options...
alfr Posted October 16, 2020 Share Posted October 16, 2020 I have no problem running it on our HyperServer on IIS. So probably something in your environment? est.exe: 000010A4: 19:17:52 [TUniServerModule]:Server Shutdown Completed. test.exe: 000010A4: 19:17:52 []:<--------------------------------------------------------------> test.exe: 000010A4: 19:17:52 [Terminated]:Exit Code: 0 test.exe: 000013B4: 19:18:04 []:>--------------------------------------------------------------< test.exe: 000013B4: 19:18:04 [TUniServerModule]:Server First Init. test.exe: 000013B4: 19:18:04 [TUniServerModule]:Node Id = 0 test.exe: 000013B4: 19:18:04 [TUniServerModule]:Node MaxSessions = 250 test.exe: 000013B4: 19:18:04 [TUniServerModule]:Starting HTTP Server on Port: 16384... test.exe: 000013B4: 19:18:04 [TUniServerModule]:HTTP Server Started on Port: 16384 test.exe: 00002BC8: 19:18:35 [Requested Theme File not found:]:C:\uniGui\Framework\unigui\uni\css\uni-xtheme-classic.css test.exe: 00002BC8: 19:18:35 []:TUniThemeProps: File not found: C:\uniGui\Framework\unigui\uni\css\uni-xtheme-classic.css test.exe: 0000354C: 19:18:54 []:Node-0, Terminate Started. test.exe: 000013B4: 19:18:55 [TUniServerModule]:Shutting Down Server. test.exe: 000013B4: 19:18:55 [TUniServerModule]:Stopping HTTP Server. test.exe: 000013B4: 19:18:56 [TUniServerModule]:HTTP Server Stopped. test.exe: 000013B4: 19:18:56 [TUniGUISessionManager]:Terminating Session manager. test.exe: 000013B4: 19:18:56 [TUniGUISessionManager]:Stopping Cache Eraser... test.exe: 000013B4: 19:18:56 [TUniGUISessionManager]:Cache Eraser Stopped. test.exe: 000013B4: 19:18:56 [TUniGUISessionManager]:Destroying Worker Threads. test.exe: 000013B4: 19:18:56 [TUniGUISessionManager]:Session manager terminated. test.exe: 000013B4: 19:18:56 [TUniServerModule]:Server Shutdown Completed. test.exe: 000013B4: 19:18:56 []:<--------------------------------------------------------------> test.exe: 000013B4: 19:18:56 [Terminated]:Exit Code: 0 test.exe: 00001864: 19:18:56 []:>--------------------------------------------------------------< test.exe: 00001864: 19:18:56 [TUniServerModule]:Server First Init. test.exe: 00001864: 19:18:56 [TUniServerModule]:Node Id = 0 test.exe: 00001864: 19:18:56 [TUniServerModule]:Node MaxSessions = 250 test.exe: 00001864: 19:18:56 [TUniServerModule]:Starting HTTP Server on Port: 16384... test.exe: 00001864: 19:18:56 [TUniServerModule]:HTTP Server Started on Port: 16384 Quote Link to comment Share on other sites More sharing options...
stevewong Posted November 18, 2020 Author Share Posted November 18, 2020 I finally figured it out ! To make a RESTFUL call, you need to use the component NetHTTPClient. In order to use TNetHttpCleint under IIS ISAPI environment, you need to do the following : Under Application Pool -> your application -> Advance Setting -> Process Mode -> Identity -> Built in Account -> Network service Then under the web application's Authentication Setting -> make Application Pool identity the default option. (using specific user : IUSR will cause cause an exception whenever you call TnetHttpClient.create) I don't know why, but I hope this information helps. Steve 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.