Jump to content

Search the Community

Showing results for tags 'zeos'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • uniGUI Public
    • Announcements
    • General
    • Feature Requests
    • Installation
    • Deployment
    • Other Platforms
  • Licensing
    • Licensing
    • Ordering uniGUI
  • Bug Reports
    • Active Reports
    • Closed Reports
    • Old Bug Reports
  • uniGUI Development
    • General Development
    • uniGUI Releases & Roadmaps
    • Utilities
  • Mobile Platform
    • uniGUI Mobile
    • Mobile Browsers
  • Users Area
    • Sample Projects
    • Components and Code Samples
    • Third Party Components
  • Non-English
    • Non-English
  • Miscellaneous
    • Hosting
    • Server Security
    • Jobs

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. Hello, I am a bit clueless with a big problem I need to solve ASAP. The current situation is as followed. I am running on a Windows 2016 server two uniGui Applications. One works as a non visual DB server, which feeds an external PHP Shop Application with information like articles , prices, etc. The other one is a Backend Application, which handles all the articles from the shop. So this behaves more like the standard uniGui Application we all know, using all the nice uniGui visual components we all love. But my problem comes from the non visual application, which sometimes is not reachable, which means API calls from the PHP application do not get any response. Main part of this application is the Methode "UniGUIServerModuleHTTPCommand", which looks like this: procedure TUniServerModule.UniGUIServerModuleHTTPCommand(ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo; var Handled: Boolean); var sJSON, sParam, sRequest, s : string; i : integer; bValidRequest : boolean; begin // Examples of Supported APIs: // http://localhost:8077/v1/prom?ID=47 >> Get Details of selected event with the ID 47 // http://localhost:8077/v1/Prom/CheckAvail >> Check if server is online // http://localhost:8077/v1/Proms >> Get List of current events bValidRequest := false; if pos('/v1', ARequestInfo.URI) = 1 then // API Call found !! begin AResponseInfo.ResponseNo := 200; Handled := True; if ARequestInfo.AuthExists and (ARequestInfo.AuthPassword='wshgdaizuddsfrtG12') and (ARequestInfo.AuthUsername='XCloud') then begin sRequest := Uppercase(ARequestInfo.URI); if sRequest = Uppercase('/v1/Prom/CheckAvail') then // Checking the API accessibility during the purchase process begin bValidRequest := true; sJSON := '{"status": "online"}'; AResponseInfo.ContentText := sJSON; LogPayServer('HTTP Request "CheckAvail"', sJSON); end; if sRequest=Uppercase('/v1/Proms') then // Returns a list of all currently active proms in JSON format. begin bValidRequest := true; sJSON := GetEventsAsJSON; LogPayServer('HTTP Request "Proms"', sJSON); AResponseInfo.ContentText := sJSON; end; if sRequest=Uppercase('/v1/Prom/OrderConfirmed') then // Called after the sales process has been completed begin sJSON := ARequestInfo.RawHeaders.Values['OrderInfo']; // Process received order information LogPayServer('HTTP Request "OrderConfirmed"', sJSON); if AddJsonOrderInformationToDB2(sJSON) then begin LogPayServer('HTTP Request "OrderConfirmed"', 'bValidRequest=true'); bValidRequest := true; AResponseInfo.ContentText := '{"status": "processed"}'; // if everything is OK, than return follwing: end else LogPayServer('HTTP Request "OrderConfirmed"', 'bValidRequest=false'); end; if sRequest=Uppercase('/v1/Prom') then begin sParam := ARequestInfo.Params.Values['VoucherVal']; // Request to check the value of the given voucher if sParam <>'' then begin bValidRequest := true; // Get from DB the value of the given voucher and return it to JSON sJSON := '{"voucher value": '+GetVoucherValue(ZConnectionServerModule, sParam)+'}'; AResponseInfo.ContentText := sJSON; LogPayServer('HTTP Request "VoucherVal" ('+sParam+')', sJSON); end; sParam := ARequestInfo.Params.Values['Id']; // Returns information of the event, which was selected via its Id if sParam <>'' then begin bValidRequest := true; sJSON := GetEventDetailsJSON(sParam); AResponseInfo.ContentText := sJSON; LogPayServer('HTTP Request "Prom?Id=?"', sJSON); end; end; if not bValidRequest then begin AResponseInfo.ContentText := '<html>Not supported API-Call; Please check API documentation!</html>'; LogPayServer('HTTP Request "API ERROR"', ARequestInfo.URI); end; end else begin AResponseInfo.ContentText := '<html>Wrong or missing PW; Please use Basic Auth!</html>'; LogPayServer('HTTP Request "Invalid Caller"', 'PW / Auth wrong'); end; end; end; The Internalisation Methode is also simple and straightforward: procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject); begin sHTML1 := tStringList.Create; sHTML2 := tStringList.Create; with ZConnectionServerModule do begin Connected := False; LibraryLocation := StartPath+'files\dll\libmysql.dll'; Protocol := 'mysql'; HostName := 'localhost'; Port := 3306; Database := 'xxxxx'; User := 'root'; Password := '-----'; Connected := true; end; LogPayServer('UniGUIServerModuleCreate','Server V'+FileVersionGet(StartPath+'AbiPaymentServer.dll')+' Created and running'); end; I am mentioning it here because as you can see it also uses a Log-Call, which writes information to a log table within my MySQL database and I can find randomly entries in the log, which show me that the application was restarted. At the moment the traffic handled by this Application is very low (less than 10 API calls per hour). Nevertheless I have the problem that the Application does not response and is not reachable sometimes. This is something I have not seen as long as I used it as standalone Application. Any comments or help are more than welcome!
×
×
  • Create New...