

ertank
-
Content Count
258 -
Joined
-
Last visited
-
Days Won
1
Posts posted by ertank
-
-
Hello,
I am using TNetHTTPClient for reading some REST web service data over HTTPS.
Some users have multiple web services to read data from.
Some of these users with multiple web services have frequent checks (check every minute, or even check each 10 seconds).
So they have several times a day below DNS resolution errors showing up in logs.
The application also reach the same web service(s) but different end points from its UI part.
All of these are under exact same domain per web service.
Error sending data: (12007) The server name or address could not be resolved
Since the application (thread) read some data from the exact same URL one minute ago, I cannot understand why such errors get logged.
The error also occasionally occurs on the UI part of the application.
My web searches all point to the DNS server problems. Users' DNS servers are fine as per my tests. Though, it is not possible to make a test at the error time.
I am trying to understand why this error happens where domain was resolved one minute ago (or even 10 seconds ago).
Any help is appreciated.
Thanks & Regards,
Ertan
-
-
On 4/29/2024 at 3:48 PM, msi1393 said:Hello
And thank you for your guidance
I tried every guide I could find but it didn't work.
Actually, I want to do the following code in Delphi
that I can use a software implemented with #C
I am attaching the text file of the class related to the dll created in C#You do not need to use the DLL. You already have complete DLL code as far as I can tell. I think it is possible to convert that code to Delphi.
I cannot be sure about the details of C# encryption method. It seems like DES, CBC and PCKS#7 padding. You need to confirm that information.
Once you have all details, there are several free encryption libraries available for Delphi which can help you do the same directly in your project without any need for a DLL.
You can install LockBox from GetIt as an example. There are other alternatives and you may want to check some of them.
In case you are using older versions of Delphi like Delphi 7, you can still build your own DLL using a recent version in case you are not able to use the cryptography library in your Delphi version.
Nowadays there is a lot of AI use. They can also help you convert that C# code into Delphi. if you choose to do it that way just make sure that final code is actually correct.
-
I am missing hints displayed when mouse cursor waits on form objects while working on VCL form design. Show designer hints is checked in the options.
Can anybody reproduce?
There must be something on my daily system. VM test system seems to be working fine. Go figure.
-
You might want to use https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer
BTW, I personally value logging which helps finding where it stops
-
18 hours ago, admar said:is working on explorerr
Browsers mostly do GET request. How do you make a POST request using explorer?
BTW, your example code feels like you are not actually bound to DataSnap. I suggest you to check out MARS-Curiosity https://github.com/andrea-magni/MARS
-
-
Hello,
I want to conditionally change stock ImageListItemBottomDetail appearance TListViewItem (not the list but a single item) background color at runtime.
Stylebook - background changes for whole background as far as I can see.
Any help is appreciated.
Thanks & Regards,
Ertan
-
Hello,
I tried to import below URL and resulting unit has errors.
https://einvoiceserviceturmobtest.luca.com.tr/InvoiceService/ServiceContract/InvoiceService.svc?wsdl
I don't know if WSDL is erroneous or Delphi cannot cope with it. I wonder if there is a way to have it imported properly.
Any help is appreciated.
Thanks & Regards,
Ertan
-
Problem was indeed the packed. Removing it solved the problem.
Thank you.
-
1
-
-
Hi,
There is a DLL that has demo project in C#.NET code that I would like to convert into Delphi
public struct AcquirerAmount { public uint id; public ulong amount; } public struct InposEcrPayment { public const ushort MAX_ACQUIRER_COUNT = 8; public ulong totalAmount; public uint totalCount; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public AcquirerAmount[] acquires; }
So far I converted above struct as below but data incoming is not correct. I believe that Delphi conversion is not correct.
TInposAcquirerAmount = packed record Id: UInt32; Amount: UInt64; end; TInposEcrPayment = packed record TotalAmount: UInt64; TotalCount: UInt32; Acquires: Array[0..7] of TInposAcquirerAmount; end;
Any help is appreciated.
Thanks & Regards,
Ertan
-
2 hours ago, Dave Nottage said:Note that I have not tested the code above - I am just going by the documentation (which I linked to)
I tested it on Android 12 and and it is working just fine.
Original SO answer was missing the case match of the function and its declaration type which I should be careful for the next time.
Thanks for the help.
-
1
-
-
Hello,
Android has 24H/12H hour display format setting.
I wanted to format my time values displayed as in system settings but I couldn't find how to read that specific is24HourFormat value.
Delphi TFormatSettings does not include that information.
There are earlier SO threads like this one. But that code gives me
Invoke error: method not found.
I also tried to import "android/icu/text/DateFormat" that I found in another SO answer and the app crashes without any error displayed.
What would be the correct way to read that system setting?
Thanks & Regards,
Ertan
-
Speaking about Delphi 12.2 Inline Update 1.
I am told that Windows 10 and Windows 11 changes the experience.
Delphi is giving problems on Windows 11 and identical (down to installed components) system on Windows 10 works just fine.
-
On 9/26/2024 at 2:14 PM, dmitrybv said:Is it possible that rsvars.bat does not set all the necessary environment variables for MSBuild to work correctly
When I was adding Delphi 12.2 in our build server I remember below value was missing in rsvars.bat
BDSLIB=C:\Delphi12.2\lib
You need to point it to your correct directory.
-
1
-
-
Answer to your question depends on your needs.
I don't use ISS or Nginx for about 200 clients using MARS Curiosity as my REST server.
mORMot2 is another Open Source Client-Server ORM SOA MVC framework and uses REST which tested to serve millions of requests under certain conditions.
It is up to you to choose your REST server framework and any load balancer if you need it.
-
9 hours ago, Nektarios said:All the videos, tutorials, books are assuming that there is a database file created in Microsoft Access or something like that. I don't want that. I want the user to create and manipulate the data by using my app only.
If you want to prevent others accessing the data input in the application, you can encrypt a SQLite3 database and data will not be able to read by other software unless your encryption key and method is found.
https://docwiki.embarcadero.com/CodeExamples/Sydney/en/FireDAC.SQLite_Encryption_Sample
There are a lot to consider for saving data to disk file or reading from it. A database system already handles these for you.
-
Below works for me without any exception. I see "All good" message and debugging shows data is actually in LResult variable.
uses System.Net.HttpClient, System.Net.HttpClientComponent; procedure TForm1.Button1Click(Sender: TObject); var LHttp: TNetHTTPClient; LResponse: IHTTPResponse; LResult: string; begin LHttp := TNetHTTPClient.Create(Self); try try LResponse := LHttp.Get('https://www.google.com/index.html'); except on E: Exception do begin ShowMessage('Cannot communicate' + sLineBreak + E.Message); Exit(); end; end; if (LResponse.StatusCode < 200) or (LResponse.StatusCode > 299) then begin ShowMessage('Error status received'); Exit(); end; LResult := LResponse.ContentAsString(); ShowMessage('All good'); finally LHttp.Free(); end; end;
You may want to test this code in a new project.
If you do not get exception for google, but some other URL. You need to be sure that you are not downloading something binary.
There are binary contents that can be retrieved using GET and these cannot be simply read as string.
For example, I download my application update setup executables using GET into a TStream.
-
Hi,
I do not see any problem that may raise such an error in the shared code.
You might want to check other events assigned to f_NetHTTPRequest. Exception may be raising in them.
If you are sure that TIndigoHttp.GetText() is where the error occurs then which line is it?
What is the computer codepage that you are making tests.
BTW, your request might complete without exception. But response received might be an error.
I would check if "f_StatusCode" is in successful response range. In my own code I check it to be ">= 200" and "<= 299"
-
On 7/29/2024 at 1:17 PM, Alex40 said:A month and a half later the problem is not fixed YET. 😞
I would consider switching to an HTTP client of your choice and stop using TREST components.
-
I would suggest to use SQLite on a mobile device rather than FirebirdSQL if you do really need to save some data on the device itself.
Is there any particular reason you want to use FirebirdSQL?
-
1
-
-
9 minutes ago, Sonjli said:Sorry, you're right. Mine is JSON data and still compressed, not XML. Thanks!
Just check the link. There is OJson with "SAX" parsing as well.
-
1
-
-
If your concern is high memory usage, you can try OXml and use SAX parser. If your data is well structured, you can also use Delphi classes together with SAX parsing. This would dramatically reduce memory consumption compared to System.JSON.
However, your problem is not clear as stated earlier. You might want to add details.
-
1
-
-
13 minutes ago, Vincent Parrett said:I also wish these forums had a dark mode!
I asked that before and got a suggestion for https://github.com/darkreader/darkreader
Might work for you, too.
-
2
-
SOAP problem
in Network, Cloud and Web
Posted
Hello,
There is a lot if information missing in your question. At least you didn't share what the error message you are receiving.
This is only a guess: Are you sure that you need to pass BASE64 data as TBytes to datoteka? My experience is that WSDL import handles Byte -> Base64 encoding for you. In other words, you can try to assign
Above code assumes you have a recent enough Delphi version that has System.IOUtils.TFile.ReadAllBytes()
BTW, you really should secure your created objects in a try..finally block.