Search the Community
Showing results for tags 'XML'.
-
Hello, Can anyone help me? I have a simple application with a login and a main menu form, very usually, but with a particular parameters in the URL, I need to provide a simple, unformatted text content to the respective user's web browser (that text can be a JSon, XML, OData, etc). This URL contains authentication parameters (something like "127.0.0.1:8077/?authkey=700UB7BN3FM1ZMN"). I need to use the "UniGUIMainModuleBeforeLogin" event of the "UniMainModule", to validate this authentication key, determine which user is accessing the data and only if that key/user is validated, select their respective data and generate the plain text in the format that need. What I need is simple: When this URL with parameters are acessed, after the validation on the "UniGUIMainModuleBeforeLogin" event, instead of showing the Main Menu screen, I need that this simple text (which can be a text in the OData, JSon, XML, etc.) return that plain string back to the user's web browser. Attached is an image that shows what I need. My UniGUI version is "FMSoft uniGUI Complete Professional 1.0.0.1423". I have tried the following approach: procedure TUniMainModule.UniGUIMainModuleBeforeLogin(Sender: TObject; var Handled: Boolean); var xAuthKey, xUserInfo, xStrData : string; begin Handled := False; //Try to get authentication info xAuthKey := (Sender as TUniGUISession).UniApplication.Parameters.Values['odata']; if not xAuthKey.IsEmpty then begin //Validate authentication info and gets the user info xUserInfo := GetUserInfo(xAuthKey); if not xUserInfo.IsEmpty then begin //GetStrData returns information of database based on user info //It can be a JSon, a XML or OData, or even, a simple text xStrData := GetStrData(xUserInfo); { Down here i got troubles } TUniGuiSession(Sender).AResponse.ContentType := 'text/plain'; //tried: 'text/plain', 'text/xml', 'application/json', and others TUniGuiSession(Sender).AResponse.ContentText := xStrData; TUniGuiSession(Sender).AResponse.WriteContent; { Up here i got troubles } //Don't show de login form Handled := True; end; end; end; I tried other approach too, but still nothing: procedure TUniMainModule.UniGUIMainModuleBeforeLogin(Sender: TObject; var Handled: Boolean); var xAuthKey, xUserInfo, xStrData : string; begin Handled := False; //Try to get authentication info xAuthKey := (Sender as TUniGUISession).UniApplication.Parameters.Values['odata']; if not xAuthKey.IsEmpty then begin //Validate authentication info and gets de user info xUserInfo := GetUserInfo(xAuthKey); if not xUserInfo.IsEmpty then begin //GetStrData returns information of database based on user data //It can be a JSon, a XML or OData, or even, a simple text xStrData := GetStrData(xUserInfo); { Down here i got troubles } //Here I got a ajax erro message dialog, with the content of xStrData (Even with the ExecCode param True) TUniGuiSession(Sender).SendResponse(xStrData, False); { Up here i got troubles } //Don't show de login form Handled := True; end; end; end; It must be something simple, but I can not do it. I searched a lot in the forums and did not find anything like what I want to do. Thank you in advance.
- 10 replies
-
- URL
- HTTPResponse
-
(and 3 more)
Tagged with:
-
Dear, I consult them, I need to make my application unigui, talk to another remote php application, what should I do? I understand using a webservice / XML / JSON, another. I will appreciate your support and feedback as could do this task.
- 5 replies
-
- webservices
- json
-
(and 1 more)
Tagged with:
-
Hi, I need load an xml document in unigui application, but, i get this error "Microsoft MSXML is not installed" I understand that unigui is multithread and Txmldocument in multithread must execute CoInitializeEx(nil, COINIT_MULTITHREADED); and CoUnInitialize; How i can do this? somebody can help me??? thanks. XMLdoc.zip
- 4 replies
-
- MSXML
- TXMLDocument
-
(and 1 more)
Tagged with: