I'm using Delphi XE2 to build a DataSnap HTTP REST server to run as a service on Windows 2008. I read somewhere that by default the HTTP 'KeepAlive' is disabled for DataSnap server projects, if so can somebody help as to how to enable this. Thanks.
The Server has a property KeepAlive, which should be set to true.
Related
I have a rad server application hosted in IIS.
Client send requests to this rad server and server respond to it - all fine here.
but now, certain times, to cater the client's request, the rad server has to send request to another server. (for ex : jasper report server).
my problem is, when the client requests such a request, the rad server fails to execute the request to the jasper server, and in browser when I test this request I get the response : Client : REST request failed: Error sending data: (12002). Ideally it should have downloaded a pdf and placed it in the documents folder. Such requests works perfectly when I run from RAD development server. But the RAD Server hosted in IIS fails to do this.
The endpoint is /GetReport which calls a function called DownloadReport (written in a datamodule) which will execute a TRestRequest.Execute which requests for the report from the jasper report server. But here, the .Execute wont just get executed at all no exception are thrown either inside DownloadReport method.
I turned off firewall in bother the systems. Is there something that I must configure in the RAD server application's INI so that the RAD server can communicate to another server ? or is there anything that I should configure in IIS ?
Can somebody help me to resolve this ?
I could solve this as follows :
The TRestRequest object which sends request to the Jasper Report Server should have its property SynchronizedEvents set to False. When ran from the RAD Development server, this property should be set to True.
I have an Azure Cloud Service Virtual Machine with 2 server:
Java project using Jetty server at http://localhost:8999
ASP.NET MVC project using IIS Express at http://localhost
I am using Http request to make connection between 2 server.
In my VM, inside ASP.NET MVC project, I use http://localhost:8999 to get data from Jetty server. It works perfectly with short response time (from 100ms to 6000ms).
However, when I access the IIS Express via Internet using http://mydomain.cloudapp.net. It does not work anymore.
Then I change my config file in ASP.NET MVC project to use http://mydomain.cloudapp.net:8999. It works but with long response time (from 15s to 40s). This is because of my slow internet connection.
My question is:
If I access IIS Express via Internet, to avoid external internet connection, is there any solution which let IIS Express know that it's target is local?
Which means I can still use http://localhost:8999 in my config file in ASP.NET MVC project, and it still work if I access IIS Express via Internet not only via localhost.
The main question is how you connect between the two servers? From the client side (JavaScript) or the ServerSide (Controller action/private method).
From what you describe it seems that you make XMLHttpRequest (JavaScript, AJAX, jQuery, etc.) call from your client side directly to your Jetty Server. In order to avoid roundtrips, you have to change this and make XMLHttpRequest to Your Server (MVC), then on the MVC backend (Controller action, or private method, or Repository) make the Jetty server call and transparently return the answer to the calling client.
You can also try tweaking your Jetty Server settings to allow for longer script execution.
Are there free WebSocket client implementations for Delphi? I found only this one:
WebSockets Delphi Components
but it is not free.
Here is my open source library:
https://github.com/andremussche/DelphiWebsockets
I've added support for WebSockets to xxm. Not all handlers support the required IXxmRawSocket interface, but the Apache httpd module (xxmAHttpd) and the SCGI handler do, and I still get the best results with the standalone 'raw' handler xxmHttp. See more here.
I have a DataSnap server written in Delphi XE3, deployed as an ISAPI module with SSL.
I'm writing a client application for this server, but it has to be written in Delphi 2010 for now. I'm having trouble connecting to the server through HTTPS. I have no trouble connecting to the server through HTTP.
I can write a client in XE3 that connects through HTTPS and succeeds, so I know the server is working fine.
The error I receive is:
Protocol HTTPS can be used after an adequate instance of TDBXCommunicationLayer is registered with TDBXCommunicationLayerFactory.
I've googled the solution to a problem like this and was instructed to add DSHTTPLayer to the uses clause of my unit, and that works for HTTP, but it's not working for HTTPS.
Any ideas out there? Thanks a lot for your time.
I ended up using TIdHTTP and TIdSSLIOHandlerSocketOpenSSL components to connect via HTTPS. I parsed the JSON with a TJSONParser. Delphi 2010 doesn't support HTTPS through the TDSRestConnection.
I want to send email to Yahoo mail using Indy. But Yahoo uses 465 port with SSL connection. I don't know how to implement that in my program. I have read about TIdSSLIOHandlerSocketOpenSSL component on internet, but couldn't find such component in Delphi 7. Can anyone help?
I have found that Synapse library is much easier to use. Look at the code example I use: How To Use SMTP with TLS
In Delphi 6/7 the component was called TIdSSLIOHandlerSocket. This was Indy 8/9. It still uses Open SSL. I don't know why they changed the name in Indy 10.