Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,874
» Latest member: rhody67
» Forum threads: 2,139
» Forum posts: 10,409

Full Statistics

Online Users
There are currently 356 online users.
» 5 Member(s) | 349 Guest(s)
Bing, Google, cnbporta, rhody67, softwareshoviv, Stevenvax, ThomasBism

Latest Threads
iw15.5.10 does not addres...
Forum: IntraWeb General Discussion
Last Post: valmeras
7 hours ago
» Replies: 2
» Views: 162
Cookies with the SameSite...
Forum: IntraWeb General Discussion
Last Post: valmeras
03-27-2024, 06:59 PM
» Replies: 0
» Views: 52
303 Redirect and Response...
Forum: IntraWeb General Discussion
Last Post: ALW2019
03-26-2024, 02:30 PM
» Replies: 0
» Views: 87
smmFunctions.pas
Forum: IntraWeb General Discussion
Last Post: Mikael Nilsson
03-26-2024, 10:33 AM
» Replies: 0
» Views: 98
TIWjQDBGrid paging
Forum: IntraWeb General Discussion
Last Post: troberts
03-26-2024, 04:06 AM
» Replies: 0
» Views: 100
Problem with cache and 40...
Forum: IntraWeb General Discussion
Last Post: troberts
03-25-2024, 01:54 AM
» Replies: 0
» Views: 110
IWModalWindow from differ...
Forum: IntraWeb General Discussion
Last Post: bjoernb
03-24-2024, 10:52 PM
» Replies: 0
» Views: 132
jQGrid css and js files
Forum: IntraWeb General Discussion
Last Post: medzoom
03-22-2024, 07:06 PM
» Replies: 2
» Views: 2,524
iwSelect list update in a...
Forum: IntraWeb General Discussion
Last Post: joelcc
03-20-2024, 08:07 PM
» Replies: 0
» Views: 142
IntraWeb Certificate Mana...
Forum: IntraWeb General Discussion
Last Post: DavidChiq
03-19-2024, 06:27 PM
» Replies: 1
» Views: 2,086

 
  Parameters
Posted by: mike.price@asterox.net - 01-08-2023, 10:58 AM - Forum: IntraWeb General Discussion - Replies (2)

I have developed a simple ISAPI program Intraweb 15 latest Delphi.

Deploys and work great this is the URL slightly changed: http://88.209.225.199:8092

I want to send parameters to the app when I start it.

I am sorry this must be so simple but I have been searching for hours for solution with no luck.

So how do I add parameters to that URL and how do I read them in Intraweb app

Thanks Mike

Print this item

  IWCertificateManager
Posted by: MJS@mjs.us - 01-06-2023, 10:44 PM - Forum: IntraWeb General Discussion - Replies (2)

For AToZed:  I'm assuming it's ok to bundle and digitally sign IWCertificateManager with customer installs?

Print this item

  After change to http.sys, errors on production servers after a few days of operation
Posted by: magosk - 01-03-2023, 10:56 AM - Forum: IntraWeb General Discussion - Replies (9)

Hi,

let me give you some background info first: We have a couple of production servers powering a SaaS solution, one of them serving as a master and the other a slave (continuously getting data backups from the master). These both contain three IntraWeb standalone applications (running as services) as well as a number of other backend services (some of which expose APIs). Previously, these services listened on different ports (for https traffic), with an external firewall translating calls on the standard 443 port for different external IP addresses (connected to unique URLs) to the port used internally on the server. The three IW services as well as a couple of APIs written in Delphi were all using OpenSSL, whereas one .NET service used Windows own SSL functionality for its API. As we were running out of IP addresses on the hosting site, we decided to refactor our applications to all using http.sys, so that all services could share the same port and external IP address (being distinguished by different paths in the URL, such as '/api', '/m' etc.), . A secondary reason was for not being stuck with OpenSSL 1.0.2 as this no longer receives updates.

This all worked well in test environments and also initially after upgrading our production services to the new version using http.sys. However, after a few days of operation the master server started getting various errors, which could not be resolved by anything else than a restart of the server. This repeated itself every 2 or 3 days. We tried switching operation to the other (slave) server, but then the same errors occurred there (after running a few days). We also tried upgrading the OS of one of the servers to Windows Server 2019 (previously both were running Windows Server 2012), but it did not solve the problem. The errors we saw in our maintenance logs had not occurred before the upgrade. They affect different services and you do not see any obvious connection between them, but once one of the errors started occurring, the others soon followed. My guess is that they are different symptoms of the same underlying issue, but not necessarily a clue to what the root problem is. These are the errors we have seen:


  1. Exception EMenuError with message 'Out of system resources' raised when trying to set Enabled to False for menu item (from an IntraWeb application)
  2. A command-line application sox.exe used for audio file conversions fails, and you could (at least in Win 2012) see a corresponding error for a kernel dll in the Windows Event log.
  3. Parsing of XML files using MSXML (Microsoft XDOM) fails.
  4. Failing to set up a new connection to a NexusDB server using a so called SharedMemory transport.
  5. Seeing error event 10010 in Windows event log (timeout error for DistributedCOM), however not seemingly connected to an event in any of our services.   

We have improved error handling in our code, removed unnecessary usage of the sox application, replaced MSXML with OXML, using another type of transport towards nxServer etc. making our applications more robust against the errors, but the errors 1, 2 and 5 still do occur typically after 2-10 days of operation since the last restart and then we need to restart again. Has anyone else experienced similar problems? Any insights to as to why this is happening, and possible solutions or workarounds would be much appreciated.

Best regards

Magnus Oskarsson

Print this item

  TRadioGroup criados dinamicamente não retornam ItemIndex
Posted by: marcelopimentel18@gmail.com - 12-28-2022, 07:32 PM - Forum: IntraWeb Dúvidas Gerais - No Replies

Ola!

Estou criando em runtime diversos componentes TRadioGroup com base em uma TStringList.

Code:
          tRadio := TIWRadioGroup.Create(Self);
          tRadio.Name := 'IWRadioHCMI' + IntToStr(iContHCM);
          tRadio.ItemIndex := 0;
          tRadio.Items.Add('Inativo   ');
          tRadio.Items.Add('Importar   ');
          tRadio.Items.Add('Exportar   ');
          tRadio.Layout := glHorizontal;
          tRadio.Parent := IWRegionI;
          tRadio.Height := 13;
          tRadio.Width := 200;
          tRadio.Left := 20;
          tRadio.Top := 33 + (iContHCM * 28);
          tRadio.Font.Size := 10;
          tRadio.Anchors := [akLeft,akTop];

A criação funciona e os TRadioGroup são exibidos na interface normalmente.

Porém, quando tento retornar o itemindex selecionado pelo usuário no HTML, ele sempre retorna -1, como se nada tivesse sido selecionado.

Um detalhe interessante, o FindComponent retorna o nome e os itens criados normalmente, o unico problema é retornar a interação do usuário na interface.

https://imgur.com/a/529Nyqu
(Não consegui anexar a imagem, mas acima em o resultado de um debug)

Alguém poderia me ajudar?

Print this item

  OnAsyncPageUnloaded not working on mobile
Posted by: baxing - 12-26-2022, 01:57 PM - Forum: IntraWeb General Discussion - Replies (1)

Hello, 

I tried to use IWForm's OnAsyncPageUnloaded  event for triggers when the page is unloaded on browser side (due to browser/tab closing) to close session with command.


Code:
  if AIsCurrent and (WebApplication.ActiveFormCount = 1) then
   WebApplication.SelfDestruct;

It's ok on desktop browser (Chrome, Edge) but I tested on my mobile browser (Chrome, Safari) but It's not working.

How do I get it to work on mobile?


Note :

This link for unload event, at Usage note paragraph say that :

Quote:Especially on mobile, the unload event is not reliably fired.


Thank you

Print this item

  Using C++Builder to access columns of TIWDBGrid
Posted by: Ibouka - 12-20-2022, 06:59 PM - Forum: IntraWeb General Discussion - Replies (3)

Hi!
I followed this Delphi sample for accessing columns of a TIWDBGrid using C++Builder, but it does not work. 
Below is my code:

Code:
__fastcall TForm1::TForm1(TComponent* Owner) : TFrame(Owner)
{//
 TRESTClient *REST1Client = new TRESTClient(this);
 TRESTRequest *REST1Request = new TRESTRequest(this);
 TRESTResponse *REST1Response = new TRESTResponse(this);
 TClientDataSet *ClientDataSet1 = new TClientDataSet(this);
 TRESTResponseDataSetAdapter *REST1ResponseDataSetAdapter = new TRESTResponseDataSetAdapter(this);

 ClientDataSet1->AfterOpen = &ClientDataSet1AfterOpen;

 REST1Client->BaseURL = "my.URL.php";
 REST1Request->Client = REST1Client;
 REST1Request->Response = REST1Response;
 REST1Response->ContentType = "application/json";
 REST1ResponseDataSetAdapter->Dataset = ClientDataSet1;
 REST1ResponseDataSetAdapter->Response = REST1Response;
 REST1ResponseDataSetAdapter->Active = true;
 REST1Request->Execute();

 TDataSource *DataSource1 = new TDataSource(this);
 DataSource1->DataSet = ClientDataSet1;
 IWDBGrid1->DataSource = DataSource1;

// dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[0])->Width = (IWDBGrid1->Width/20) * 02; // => Argument out of range
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ClientDataSet1AfterOpen(TDataSet *DataSet)
{//
 dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[0])->Width = (IWDBGrid1->Width/10) * 2; // => Argument out of range
 dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[1])->Width = (IWDBGrid1->Width/10) * 1;
 dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[2])->Width = (IWDBGrid1->Width/10) * 4;
 dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[3])->Width = (IWDBGrid1->Width/10) * 3;

 dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[0])->Title->Text = "AFirstTitle";
 dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[1])->Title->Text = "ASecondTitle";
 dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[2])->Title->Text = "AThirdTitle";
 dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[3])->Title->Text = "AFourthTitle";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::IWDBGrid1Render(TObject *Sender)
{//
 // dynamic_cast<TIWDBGridColumn*>(IWDBGrid1->Columns->Items[0])->Width = (IWDBGrid1->Width/10) * 2; // => Argument out of range
}
//---------------------------------------------------------------------------

I am having the error message "Argument out of range" beginning from the first line and for each line.
Any idea of how to get rid of this error?

Print this item

  IntraWeb 15.2.69 is out!
Posted by: Alexandre Machado - 12-18-2022, 10:26 PM - Forum: IntraWeb General Discussion - Replies (6)

Hi guys,

there is a new update available: https://www.atozed.com/2022/12/intraweb-15-2-69/

I strongly recommend this one because it contains some critical bug fixes (also some interesting new features)

Enjoy!  Big Grin

Print this item

  Upload media to WhatsApp cloud API
Posted by: Lior I - 12-18-2022, 10:24 AM - Forum: Indy General Discussion - Replies (3)

I need to upload a PDF file to a WhatsApp Cloud API.
Can someone help me translate this WhatsApp curl example code to Delphi pascal?
Here is the code from the WhatsApp documentation (JPEG example):

Code:
curl -X POST \
  'https://graph.facebook.com/v15.0/FROM_PHONE_NUMBER_ID/media' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -F 'file=@/local/path/file.jpg;type=image/jpeg'
  -F 'messaging_product=whatsapp'

I don't know how to translate the file parameter. It includes both path and file type attributes.
Code:
-F 'file=@/local/path/file.jpg;type=image/jpeg' 


I use Delphi RIO 10.3
Thanks in advance

Print this item

  TIdTCPServer with SSL TLS?
Posted by: 3ddark - 12-16-2022, 01:45 PM - Forum: Indy General Discussion - No Replies

Can someone share a sample code that works with TIdTCPServer with SSL TLS?

Why is it so complicated or difficult? Probably I don't understand. There is a lot of different information on the internet. But I haven't seen any information that is completely correct. It could be an example reference code.

Below is the code I wrote (which I don't understand). Please someone explain to me what is missing, wrong or excessive.

1-How do I create Self-Signed SSL with OpenSSL?
2-How do I install these certificates on the server side?
3-Can I connect with the same (with Server) SSL settings for the client?

Also, after I test these codes in windows environment, I will run them under Linux.

Code:
procedure TServer.InitTCPConnection;
begin
  IdTCPServer := TIdTCPServer.Create;

  if FConfig.UseSSL then
  begin
    IdServerIOHandlerSSLOpenSSL := TIdServerIOHandlerSSLOpenSSL.Create;

    IdServerIOHandlerSSLOpenSSL.OnGetPassword := SSLIOHandlerSocketOpenSSLGetPassword;

    IdServerIOHandlerSSLOpenSSL.SSLOptions.CertFile := 'whichfile_pem_key_crt';
    IdServerIOHandlerSSLOpenSSL.SSLOptions.KeyFile := 'whichfile_pem_key_crt';
    IdServerIOHandlerSSLOpenSSL.SSLOptions.RootCertFile := 'whichfile_pem_key_crt';
    IdServerIOHandlerSSLOpenSSL.SSLOptions.Mode := sslmUnassigned;
    IdServerIOHandlerSSLOpenSSL.SSLOptions.VerifyMode := [];
    IdServerIOHandlerSSLOpenSSL.SSLOptions.VerifyDepth := 0;
    IdServerIOHandlerSSLOpenSSL.sslOptions.SSLVersions := [sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2];
  end;

  IdTCPServer.Active := False;
  IdTCPServer.MaxConnections := FConfig.MaxConnection;
  IdTCPServer.ListenQueue := 1500;
  IdTCPServer.TerminateWaitTime := 120000;
  IdTCPServer.UseNagle := False;
  IdTCPServer.ReuseSocket := rsFalse;

  if FConfig.UseSSL then
    IdTCPServer.IOHandler := IdServerIOHandlerSSLOpenSSL;

  IdTCPServer.OnConnect := IdTCPServerConnect;
  IdTCPServer.OnDisconnect := IdTCPServerDisconnect;
  IdTCPServer.OnExecute := IdTCPServerExecute;

  IdTCPServer.Bindings.Clear;
  IdTCPServer.Bindings.Add.Port := FConfig.CloudPort;
  IdTCPServer.Bindings.DefaultPort := FConfig.CloudPort;
end;

procedure TServer.IdTCPServerConnect(AContext: TIdContext);
begin
  Writeln('Wellcome :) ' + AContext.Binding.PeerIP + ' ' + AContext.Binding.PeerPort.ToString);
  if (FConfig.UseSSL) and (AContext.Connection.IOHandler is TIdSSLIOHandlerSocketBase) then
    TIdSSLIOHandlerSocketBase(AContext.Connection.IOHandler).PassThrough := False;
end;

procedure TServer.IdTCPServerDisconnect(AContext: TIdContext);
begin
  if not Assigned(AContext) or (AContext = nil) then
    Exit;
  Writeln('Disconnect: ' + AContext.Binding.PeerIP + ':' + AContext.Binding.PeerPort.ToString + ' Good Bye');
end;

procedure TServer.IdTCPServerExecute(AContext: TIdContext);
var
  RCIdByte: TIdBytes;
begin
  AContext.Connection.IOHandler.DefStringEncoding := IndyTextEncoding_UTF8;
  AContext.Connection.IOHandler.ReadBytes(RCIdByte, -1);

  FLockList := IdTCPServer.Contexts.LockList;
  try
    //Some process
  finally
    IdTCPServer.Contexts.UnlockList;
  end;
end;

procedure TServer.SSLIOHandlerSocketOpenSSLGetPassword(var Password: string);
begin
  Password := 'qwerty';
end;


I also use the following commands to generate Self-Signed certificate for OpenSSL. Are these true?
Which files created here mean Certificate for me. A lot of files are created.
Code:
@echo off

rem Certificate Authority (CA)
openssl genrsa -passout pass:qwerty -out ca-secret.key 1024
openssl rsa -passin pass:qwerty -in ca-secret.key -out ca.key
openssl req -new -x509 -days 3650 -subj "/C=TR/ST=Turkey/L=Istanbul/O=Example root CA/OU=Example CA unit/CN=example.com" -key ca.key -out ca.crt
openssl pkcs12 -export -passout pass:qwerty -inkey ca.key -in ca.crt -out ca.pfx
openssl pkcs12 -passin pass:qwerty -passout pass:qwerty -in ca.pfx -out ca.pem

rem SSL Server certificate
openssl genrsa -passout pass:qwerty -out server-secret.key 1024
openssl rsa -passin pass:qwerty -in server-secret.key -out server.key
openssl req -new -subj "/C=TR/ST=Turkey/L=Istanbul/O=Example server/OU=Example server unit/CN=server.example.com" -key server.key -out server.csr
openssl x509 -req -days 3650 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt
openssl pkcs12 -export -passout pass:qwerty -inkey server.key -in server.crt -out server.pfx
openssl pkcs12 -passin pass:qwerty -passout pass:qwerty -in server.pfx -out server.pem

rem SSL Client certificate
openssl genrsa -passout pass:qwerty -out client-secret.key 1024
openssl rsa -passin pass:qwerty -in client-secret.key -out client.key
openssl req -new -subj "/C=TR/ST=Turkey/L=Istanbul/O=Example client/OU=Example client unit/CN=client.example.com" -key client.key -out client.csr
openssl x509 -req -days 3650 -in client.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out client.crt
openssl pkcs12 -export -passout pass:qwerty -inkey client.key -in client.crt -out client.pfx
openssl pkcs12 -passin pass:qwerty -passout pass:qwerty -in client.pfx -out client.pem

rem Diffie–Hellman (D-H) key exchange
openssl dhparam -out dh1024.pem 1024

Print this item

  Updating Chart.js script
Posted by: Xenogall - 12-15-2022, 04:00 PM - Forum: IntraWeb General Discussion - Replies (2)

I've got some chart.js data in a script inside my HTML file. I can replace part of the chart.js script with tags that I then process in the IWTemplateProcessorHTML's UnknownTag event. This works when I populate the script before the HTML page is loaded. Once the page is loaded, I'm struggling to find a way to force the chart to redraw, so I can inject new data into the chart using the UnknownTag event.

I've tried using WebApplication->CallBackResponse->AddJavaScriptToExecuteAsCDATA(js) to inject some JavaScript, but I don't know enough JS to work out how to get the chart to update.

I've also tried surrounding the chart with divs and giving the div the name of an IWRegion. I then call invalidate on the region, but this didn't work for me.

Any help would be very gratefully received. Thanks.

Richard

Print this item