Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by ertank

  1. ertank

    Firebird 4.0 Unknown sql type err.

    I would still stick with FirebirdSQL v4.0 and use advised DataTypecompatibility = 3.0 parameter. You should be just fine and moreover, you will only need to disable that parameter once Delphi adds support for it in the future (most likely next year).
  2. Hello, My installation is directly open to the internet. Is it possible to identify incoming remote IPv4 numbers in MARS? Additionally, is it possible to allow permission to a method only for a specific IPv4 number? Thanks & Regards, Ertan
  3. Hello, Using Delphi 10.4.2 I get different rounded values using below code. Purpose is to round up and have 13.98 for both. uses System.Math; procedure TForm1.Button1Click(Sender: TObject); var ToBeRounded: Double; Rounded: Double; begin ToBeRounded := 55.9 * 0.25; Rounded := SimpleRoundTo(ToBeRounded, -2); ShowMessage(ToBeRounded.ToString() + ' ' + Rounded.ToString()); // ToBeRounded is 13.975 and Rounded is 13.97 at this point Rounded := SimpleRoundTo(13.975, -2); ShowMessage(Rounded.ToString); // Rounded is 13.98 at this point end; If one reads help file it has following table for expected results I do not have deep floating point knowledge. I basically know they have a lot more digits than displayed. My question is, how can I always get 13.98 as result using multiplications and such. Thanks & Regards, Ertan
  4. These numbers are read from a scale generated barcode for calculating price of a product like cheese. Barcode has weight, unit price and amount of that weight printed in numbers on it. Application was calculating total amount 0.01 wrongly. I was trying to fix that old code to have exact amount displayed on that barcode. Turns out Currency type is the way to go. I tried it and works correctly on all samples I have. The code otherwise is same including rounding functions.
  5. ertank

    Simple app for Android 5.0.2

    Hello, I am using Delphi 10.4.2. There is a very simple app (needs internet and network status permissions, 3 pages total) that I need to run on Android 5.0.2. I compiled it with stock SDK 25.2.5 targeting Android32. When package tried to be loaded on Android 5.0.2 it says Compiler error There is a problem with the packet parsing. Docwiki says Delphi 10.4.2 supports Android 6 minimum. Even Delphi 10.3.3 supports Android 5.2 mimimum. I wonder if there is some "workaround" that I can use without installing an older version. Thanks & Regards, Ertan
  6. ertank

    Simple app for Android 5.0.2

    That was my mistake. Though, it is still not working even above quote error is fixed. I was thinking, can this be because of new template values of recent Android versions? For example, I think Android 5.0.2 does not have following android:usesCleartextTraffic="true" Since my test phone has recent versions of Android, I had to add it in order to be able to test the app.
  7. ertank

    Simple app for Android 5.0.2

    It was in Turkish and I did not have access to original message. You can find it attached. Thanks. AndroidManifest.xml
  8. ertank

    thread-safe ways to call REST APIs in parallel

    Not a direct reply to the question. But, if I ever need to run parallel requests, I should be really thinking about building a custom thread class or two with main thread synchronization where needed.
  9. Hello, I am using Delphi 10.3.3, targeting Win32 executable. There is a SOAP web service that I have build a class for it. That class runs just fine on a test project. However, when I put it in my main project, I get below error DocumentElement http://schemas.xmlsoap.org/soap/envelope/:Envelope expected, :Envelope found I checked, there is only one single unit for this web service in my whole computer and both projects are using that unit. I have used different SOAP web services in the past. Some of them rarely raise "HTML found" kind of error messages, but never got ":Envelope found" until now. None of my web searches lead me to same error message that I receive. I have all requests and responses saved in text files. Comparing them I can see no difference. It is only number of records returned changes due to filter parameters. I also used Fiddler Telerik and captured whole response using both test project and main project. They are identical as far as I can tell. Test project response starts as: HTTP/1.1 200 OK Content-Type: text/xml;charset=UTF-8 Connection: keep-alive Set-Cookie: JSESSIONIDSSO=529DA436282217EF9D8D9F21515121D3; Path=/; Secure Set-Cookie: JSESSIONID=82E5260FE1737AA7C77DCE37D71B7132; Path=/listingapi/ws; Secure Server-Timing: intid;desc=d2369e80a9274e5b Date: Sun, 06 Jun 2021 19:41:44 GMT Vary: Accept-Encoding Content-Length: 15213 <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'> <env:Header/> <env:Body> <ns1:getSalesByDateRangeResponse xmlns:ns1='http://sale.individual.ws.listingapi.gg.com'> <return> <ackCode>success</ackCode> <responseTime>06/06/2021 22:41:44</responseTime> <timeElapsed>1 ms</timeElapsed> <saleCount>11</saleCount> <sales> <sale> Main project response starts as: HTTP/1.1 200 OK Content-Type: text/xml;charset=UTF-8 Connection: keep-alive Set-Cookie: JSESSIONIDSSO=7A2E4B6940B5E0E44F86FF95BBCD6C3D; Path=/; Secure Set-Cookie: JSESSIONID=0ED54949FAC10990F8F24B27B9174216; Path=/listingapi/ws; Secure Server-Timing: intid;desc=1a968daea7e9c9d9 Date: Sun, 06 Jun 2021 19:41:17 GMT Vary: Accept-Encoding Content-Length: 9877 <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'> <env:Header/> <env:Body> <ns1:getSalesByDateRangeResponse xmlns:ns1='http://sale.individual.ws.listingapi.gg.com'> <return> <ackCode>success</ackCode> <responseTime>06/06/2021 22:41:17</responseTime> <timeElapsed>225 ms</timeElapsed> <saleCount>7</saleCount> <sales> <sale> Web service WSDL can be reached from: https://dev.gittigidiyor.com:8443/listingapi/ws/IndividualSaleService?wsdl I appreciate any help, please. Thanks & Regards, Ertan
  10. Both projects are working on production. There is no test environment. I do not have problem "sending" the request. Error is raised when I receive the response. I shared both projects raw response beginnings (taken using Fiddler) to show there is no difference that would result in such an error. However, single SOAP web service project works OK. Double SOAP web service project (this and another web service supported in a single project) raises mentioned error.
  11. One additional information I should add is this main project where I am receiving error is using more than one soap web services. Thinking of that it maybe related with that RegisterInterface() or RegisterXSClass() functions used in WSDL generated web service units I tried to switch unit creation. That did not help, too. One of the web services returning its envelope as below <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> Problematic one returning its envelope as below <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Header/> <env:Body> There is this "SOAP-ENV" and "env" difference. But, they both seem to be defined properly. Moreover, I have no problem using problematic web service in a single project. Any help is appreciated. Thanks & Regards, Ertan
  12. Hello, I am trying to provide client library for FirebirdSQL database connection for a MARS-Server project. I tried a few different INI parameters, all failed including second line below FireDAC.MAIN_DB.DriverID=FB FireDAC.MAIN_DB.VendorLib="C:\Program Files\Firebird\Firebird_2_5\WOW64\fbclient.dll" FireDAC.MAIN_DB.Database=C:\Program Files\Firebird\Firebird_2_5\examples\empbuild\EMPLOYEE.FDB I wonder what I should be using to be able to use a fbclient.dll in another directory than the EXE file. Thanks & Regards, Ertan
  13. This is 32Bit client directory for a 64bit installation for FirebirdSQL. It is indeed 32bit application. No mistake here. BTW, if you check the error message in my second post above, it is trying to load a DLL file in another directory (which is EXE directory) and saying file does not exists. Indeed there is no such file with EXE file and I am trying to figure an INI parameter to provide location of that file. If I copy just fbclient.dll file from C:\Program Files\Firebird\Firebird_2_5\WOW64 next to EXE and it works just fine.
  14. This is FirebirdSQL 2.5.9. File I am putting in INI file is FirebirdSQL installation directory. I suppose anything necessary would be present there. Moreover, there is no problem for other applications to use that identical client DLL file. I think this can be eliminated from possible reasons in my specific case.
  15. 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.
  16. 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
  17. 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.
  18. 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.
  19. 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.
  20. 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
  21. 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 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
  22. 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.
  23. ertank

    How to extend CE licence?

    I did not do that. This is what I suspect reading e-mails sent from Embarcadero.
  24. 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.
  25. 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