Jump to content

ertank

Members
  • Content Count

    232
  • Joined

  • Last visited

Everything posted by ertank

  1. This is not helping in my case. I get below error which indicates a completely different dll filename First chance exception at $775DA8B2. Exception class EFOpenError with message 'Cannot open file "C:\dlp\MARS\Demos\EKON22\bin\fbclient.dll". The system cannot find the file specified'. Process EKON22ServerApplication.exe (13632) That directory mentioned in above error is the EXE directory itself. My INI file has lines in my initial post. INI file stays in the same directory as EXE and have same filename with EXE. The MARS Engine is started using below lines. My MARS code base is latest available from GitHub. procedure TMainForm.FormCreate(Sender: TObject); begin FEngine := TMARSEngine.Create(); try FEngine.Parameters.LoadFromIniFile; FEngine.AddApplication('DefaultApp', '/default', ['Server.*']); PortNumberEdit.Text := IntToStr(FEngine.Port); TMARSFireDAC.LoadConnectionDefs(FEngine.Parameters, 'FireDAC'); StartServerAction.Execute; RenderEngines(MainTreeView); except FreeAndNil(FEngine); raise; end; end; If I am missing something, let me know, please.
  2. Hello, I have following code running in a thread when application starts. procedure TMainForm.SetSystemTime(); var Sntp: TIdSNTP; begin Sntp := TIdSNTP.Create(nil); try Sntp.Host := 'pool.ntp.org'; try Sntp.SyncTime(); except // eat exception, we are in thread end; finally Sntp.Free(); end; end; When there is no internet connection, thread above code runs is never terminated. I could not find some connection timeout setting for IdSNTP. Is there any other way to terminate Sntp.SyncTime() if it is not completed for a certain period of time like 10 seconds. There is a location with a corporate firewall (with some weird settings I believe) where check for an internet connection is true, but above code still hangs. Thanks & Regards, Ertan
  3. ertank

    Internet time sync - with some timeout

    Thank you to all. My request to have access to problematic computer will not be possible until March 15 due to Covid-19 close down. I will be able to do further analysis after I do have access.
  4. ertank

    Internet time sync - with some timeout

    I just read it. Thanks for sharing. It seems similar. But, in this thread, code continues and not hangs like in my case. If I had same problem, thread would terminate without clock being synced. My problem is thread not terminating. One additional information I should share is that procedure is threaded using ITask like below. uses System.Threading, uUtils.Log; procedure TForm2.FormCreate(Sender: TObject); var Task: ITask; begin Log('Creating thread'); Task := TTask.Create(SetSystemTime); Task.Start(); Log('Thread started'); end; procedure TForm2.IdSNTP1Connected(Sender: TObject); begin Log('SNTP Connected'); end; procedure TForm2.IdSNTP1Disconnected(Sender: TObject); begin Log('SNTP Disconnected'); end; procedure TForm2.IdSNTP1Status(ASender: TObject; const AStatus: TIdStatus; const AStatusText: string); begin Log('SNTP status: ' + AStatusText); end; procedure TForm2.SetSystemTime(); var Sntp: TIdSNTP; begin Log('SetSystemTime(): System clock sync starting'); Sntp := TIdSNTP.Create(nil); try Sntp.OnConnected := IdSNTP1Connected; Sntp.OnDisconnected := IdSNTP1Disconnected; Sntp.OnStatus := IdSNTP1Status; Sntp.Host := 'pool.ntp.org'; Sntp.ReceiveTimeout := 2000; try Log('SetSystemTime(): Running actual time sync...'); Sntp.SyncTime(); Log('SetSystemTime(): System clock sync completed'); except on E: Exception do begin Log('SetSystemTime(): ' + E.Message); end; end; finally Sntp.Free(); end; Log('SetSystemTime(): Done'); end; That code sample is from a project that I am preparing with detailed logging to help identifying the problem. That code running on my system produces with following lines: 2021-01-20 14:56:58.949 Creating thread 2021-01-20 14:56:58.952 Thread started 2021-01-20 14:56:58.953 SetSystemTime(): System clock sync starting 2021-01-20 14:56:58.953 SetSystemTime(): Running actual time sync... 2021-01-20 14:56:59.067 SetSystemTime(): System clock sync completed 2021-01-20 14:56:59.068 SetSystemTime(): Done As you can see, there is no connection or disconnection here. Problem might be privilege but, this should not hang whole thread and should just exit from it. BTW, I just learned (by chance talking to a colleague) that problem occurs only on Windows 10 OSes and not on Windows 7 or Windows XP.
  5. ertank

    Internet time sync - with some timeout

    I forgot to mention in my initial post that I have already tried to change ReceiveTimeout to 2000 with no success. Sorry about that. Since ReceiveTimeout did not work that makes me believe there is a kind of a problem like privilege or initial connection. I do not know though. I cannot access to computers in that location for better understanding.
  6. ertank

    AES Encryption - FMX

    Hello, There seems to be a lot of VCL based free solutions. I could not find one for FMX platform. I am looking for a free AES256-CBC FMX compatible solution that I can pass IV and Key values manually. I installed "LockBox VCL and FMX 2.3" from GetIt package manager. It seems to take string value as Key for TLbRijndael component and does everything internally. Any help is appreciated. Thanks & regards, Ertan
  7. Hello, I have my HTTPS proxy for my HTTP REST server. Both running on my development computer. I setup HTTPS proxy following instructions here: https://twigstechtips.blogspot.com/2016/01/nginx-how-to-set-up-ssl-reverse-proxy.html These instructions makes you generate two certificate files. KEY and PEM files. I added that PEM file in my project resources as resource type RCDATA and used identifier "my_ca". I used below link to prepare my security config xml https://stackoverflow.com/questions/56301765/self-signed-certificate-in-android-application-of-rad Using "@raw/my_ca" as in that stackoverflow question is failing with below error (while packaging the app) when I try to debug run the app. network_security_config.xml:6: error: Error: No resource found that matches the given name (at 'src' with value '@raw/my_ca/') So, I prepared my XML file as following: <?xml version="1.0" encoding="utf-8"?> <network-security-config> <domain-config> <domain includeSubdomains="true">yourdomain.com</domain> <trust-anchors> <certificates src="my_ca"/> </trust-anchors> </domain-config> </network-security-config> When I try to access my REST server like https://192.168.1.152/... I get following error Failed to parse XML configuration from network_security_config On the other hand, I can get results just fine using identical URL and Postman on Windows OS. I simply failed to figure how to add that self signed certificate in my app package and use it. Any help is appreciated. Thanks & Regards, Ertan
  8. ertank

    Deploying certificate with your Android app

    I did add private key certificate as a resource as I tried to explain in my initial post. I did deploy my security config "network_security_config.xml" under "res\xml" in project Deployment. Sorry, forgot to mention that in detail. BTW, I am not trying to deploy my app in Play Store. Just trying to deploy it with my self signed HTTPS certificate.
  9. ertank

    How to extend CE licence?

    I did not do that. This is what I suspect reading e-mails sent from Embarcadero.
  10. ertank

    How to extend CE licence?

    Assuming you are actually using CE version mainly. You are excited about new 10.4 features and wanted to see them at first hand. So, you installed it on your computer for trial. You uninstalled 10.4 from your computer before the end of trial period (or after, or keeping it without using). At that point, I suspect, Embarcadero puts you (your e-mail address and relevant account linked to your CE license) in "not eligible for CE anymore" list. Hence the e-mail messages received. I wonder if that theory is correct for people having problems updating their CE licenses.
  11. Hello, I am using Delphi 10.3.3 and trying to consume a SOAP web service method. Wsdl that I need to use is below: https://dev.gittigidiyor.com:8443/listingapi/ws/IndividualSaleService?wsdl Delphi 10.3.3 successfully imports that wsdl page. Imported unit generates an output XML for "getPagedSales" method as following (included only relevant parts of XML): <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <getPagedSales xmlns="http://sale.individual.ws.listingapi.gg.com"> When same wsdl is imported using SOAP-UI application, generated sample request output starting as following: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sale="http://sale.individual.ws.listingapi.gg.com"> <soapenv:Header/> <soapenv:Body> <sale:getPagedSales> If you look closely and compare both, the SOAP-UI generated XML, envelope has "sale" in it as well as method name is put after "sale". My problem is that web service is not accepting Delphi request and returning an error as following: <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'> <env:Header/> <env:Body> <env:Fault xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'> <faultcode>env:Client</faultcode> <faultstring>Endpoint {http://application.anonymous.ws.listingapi.gg.com}ApplicationServicePort does not contain operation meta data for: {http://sale.individual.ws.listingapi.gg.com}getPagedSales</faultstring> </env:Fault> </env:Body> </env:Envelope> My question is: Is it possible to modify wsdl imported unit in a way so that out of the box SOAP adds that "sale" in relevant places of requests not just for getPagedSale mothod, but for all sale service methods? I know it is possible to use THTTPRIO.OnBeforeExecute() and send identical XML to that of SOAP-UI generated (which web service will be accepting). However, I am just trying to avoid that if it is possible. Thanks & Regards, Ertan
  12. I hope @Ugochukwu Mmaduekwe can make some comments about PKCS7 padding here. I have all below repositories and do not have problem with compilation etc. HlpIhash is part of HashLib4Pascal https://github.com/Xor-el/CryptoLib4Pascal https://github.com/Xor-el/HashLib4Pascal https://github.com/Xor-el/SimpleBaseLib4Pascal
  13. Hello, First of all, I am not experienced about technical details of variable initialization and such. I am using Delphi 10.3.3 and targeting Win32 executable. I am running multiple threads in my application. One of the threads is making rest web service calls. Other does SOAP web service calls. Below unit is only used by rest web service thread and that thread only. Rest web service requires me to do logins for every 60 minutes. Problem appears at the second hour. Login requests sent as empty strings. I am sharing only relevant lines (timeout calculations, logging etc are not included below for simplicity): unit MyRestUnit; function Login(const AppKey, SecretKey: string): Boolean; implementation function Login(const AppKey, SecretKey: string): Boolean; var Request: string; Response: string; begin if AppKey.IsEmpty then Exit(False); if SecretKey.IsEmpty then Exit(False); Request := '{"appKey":"' + AppKey + '","secretKey":"' + SecretKey + '"}'; if uUtils.Http.PostIndy(URL, Request, Response) then // Rest of the function code is irrelevant end; Code is just as in above. Request is filled in and HTTP request is made. However, Request variable is filled in for the first time function is used. It is always becoming empty for the remaining calls. My log files says application is actually sending empty request bodies. Rest web service response error also confirms that. No garbage characters just empty. If I use debug run (F9) and check variable value at run time. It holds proper value for first call, second and following calls it is always empty. Same problem exists for Release build and Debug build. Only way I could make it always work is changing above code to something like below Request := EmptyStr; Request := '{"appKey":"' + AppKey + '","secretKey":"' + SecretKey + '"}'; I tried to use different local variable names (more than one) to rule out possible name collision and it still does not work for second calls to function, unless I first make it EmptyStr. It is also interesting that I do not get any compile time hint/warning like "value assigned is not used" or similar for my second example above. I have all hints and warnings turned on in my project. My internet searches did not result in something meaningful to me. My question is: Why first example does not work for the second and following calls? Asking in here because I could not find an explanation at all and I am really curious as to why. Moreover, that is the first time I am facing such a problem. Thanks & Regards, Ertan
  14. While trying to prepare minimal reproduction I realize that there is an "else" exists above some explanatory remark lines and my Request variable assignment comes next. Turned out my mistake of leaving an else that should have been deleted at the first place. if TokenExpireTime <> 0 then begin // some other stuff with begin..end blocks end else // problem source line // some remark // another remark // more remark Request := '{"appKey":"' + AppKey + '","secretKey":"' + SecretKey + '"}'; It turned out that Request is conditionally filled in if no line above. Sorry about all the fuss and thanks to all.
  15. I just installed and tried madExcept. It doesn't report any buffer overflow or underflow (tried both). Though, there are some leaks reported like Mutex Handle, TCriticalSection, TIdThreadSafe. First one is my code in DPR file, last two being in the initialization sections of relevant units. It was interesting to have leak report even FastMM4 is not reporting any. Unfortunately, I failed to find a corruption using madExcept. I think is is harder to identify than I think it is. Thanks.
  16. I do have FastMM4 full debug open and it does not report a leak. I do not know if it also reports for corruptions though. Are there any hints/suggestions to search for such corruptions?
  17. You can use MARS with Community Edition. Some examples depend on some FireDAC units which belong to higher edition.
  18. Hello, I have orders and orderdetails tables. There is one method that should be returning several orders when used. I would like to return a json string to such requests as in following example { "orders":[ { "id":1234, "date":"2020-05-29", "details":[ { "item":"1", "amount":3 }, { "item":"5", "amount":2 }, { "item":"116", "amount":1.3 } ] } ] } I know that I can define method to return a TJsonObject and build json piece by piece in method code. However, I would like to avoid that, if possible. I wonder if there is/are some other ways of doing so in MARS. Thanks & regards, Ertan
  19. ertank

    MMX supports Delphi 10.4 Sydney

    It is released, yes. https://www.embarcadero.com/products/rad-studio/whats-new-in-10-4-sydney
  20. Actually, there is a new version released 5.0.1 which also fixes problem of opening tables with lowercase letters.
  21. Even it is not just for REST, you can write your own interface based methods and use mORMot as a REST server. Learning curve might be slower compared to some other options. However, it does run from Delphi 6 to Delphi 10.3.3 and has Linux support using Lazarus+FPC. There is no SOAP support as to my knowledge.
  22. If you have the option to choose REST only then you might really would like to consider MARS Curiosity. Edit: Just checked GitHub and it seems no packages exists for Delphi 2007.
  23. You did not run Delphi. You did not install any kind of plug-in or component. Only thing left is OS itself. Something must have been changed in your system that affects Delphi license. You can try to remember if you did some kind of "restore" or system change (computer name or alike) or hardware change during last week. You can also look for a "cleaning tool" or similar in the system and disable it for a while just for ruling out that possibility.
  24. Actually it is possible. License days start counting down from the day you activate it for the first time. Moreover, if you register and get a free license today it will have 366 days left.
×