IIS Hosted RAD Server sending request to another server - delphi

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.

Related

Server Manager opens up whenever i try to open "Turn Windows features on or off"

I'm working on ASP.NET Core MVC 2.1 application and i have AWS server to deploy it to. In my remote desktop i have placed by code in wwwroot directory in inetpub. Whenever i try to browse my application it gives me 500 Internal Server Error.
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
I looked for the solution and found that problem lies in IIS according to this URL HERE
But when i click Turn Windows features on or off in the windows menu or through control, it always open Server Manager. Can somebody tell me why this happens or how to apply the changes mentioned in the url i have specified above.
Thanks

Asp .net MVC is working when I run it locally but I get internal network error when I deploy to azure web apps?

I am having an internal server error immediately when I deploy my code to Azure web apps even though it runs perfectly fine on my own machine. My code is from a tutorial and close to this example:
https://github.com/elishnevsky/OdeToFood/tree/master/src/OdeToFood
However I do not have a web.config or an OdeToFood.xproj since they are not included in the tutorial. I tried including the ones that are in this git project but the error doesn't change. I ensured the permissions were configured to allow everyone to have full control.
My project is connected to a remote database that I can successfully connect to and manipulate from my local machine.
I have gone into the azure diagnostic tools and turned all the logging options on, however the error message being shown in the log stream doesn't change.
The error can be seen below.
I have tried including a random image to counter the favicon.ico error but that did not change anything.
Can anyone advise on some debugging tips, I think I need an idea on how to get a verbose error message.
IIS Detailed Error - 500.0 - Internal Server Error
HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred.
Most likely causes:
IIS received the request; however, an internal error occurred during
the processing of the request.
The root cause of this error depends on which module handles the
request and what was happening in the worker process when this error
occurred.
IIS was not able to access the web.config file for the Web site or
application. This can occur if the NTFS permissions are set
incorrectly.
IIS was not able to process configuration for the Web site or
application. The authenticated user does not have permission to use
this DLL.
The request is mapped to a managed handler but the .NET Extensibility
Feature is not installed.
Things you can try:
Ensure that the NTFS permissions for the web.config file are correct
and allow access to the Web server's machine account.
Check the event logs to see if any additional information was logged.
Verify the permissions for the DLL.
Install the .NET Extensibility feature if the request is mapped to a
managed handler.
Create a tracing rule to track failed requests for this HTTP status
code. For more information about creating a tracing rule for failed
requests, click here.
Detailed Error Information: Module AspNetCoreModule Notification ExecuteRequestHandler Handler aspNetCore Error Code 0x00000000 Requested URL http://OdeToFood20170518102616:80/ Physical Path D:\home\site\wwwroot Logon Method Anonymous Logon User Anonymous
More Information: This error means that there was a problem while processing the request. The request was received by the Web server, but during processing a fatal error occurred, causing the 500 error.
Microsoft Knowledge Base Articles:
IIS Detailed Error - 500.0 - Internal Server Error
HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred.
Most likely causes:
IIS received the request; however, an internal error occurred during the processing of the request.
The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
IIS was not able to process configuration for the Web site or application.
The authenticated user does not have permission to use this DLL.
The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.
Things you can try:
Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.
Check the event logs to see if any additional information was logged.
Verify the permissions for the DLL.
Install the .NET Extensibility feature if the request is mapped to a managed handler.
Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click.
Detailed Error Information: Module AspNetCoreModule Notification ExecuteRequestHandler Handler aspNetCore Error Code 0x00000000 Requested URL OdeToFood20170518102616:80/favicon.ico Physical Path D:\home\site\wwwroot\favicon.ico Logon Method Anonymous Logon User Anonymous
More Information: This error means that there was a problem while processing the request. The request was received by the Web server, but during processing a fatal error occurred, causing the 500 error.
Microsoft Knowledge Base Articles:
According to your github project, I have crate a test demo on my computer. I found this project has define a custom Physical File Provider (You could find
the it in the Middleware folder: UseNodeModules).
By cloning the project to the local, VS will automatic download the js file into the node_modules folder.
When publishing the project to azure web app service, the VS will not copy the node_modules folder to the azure web app. So the application will how 500 error.
I suggest you could find the UseNodeModules folder in the local and copy it to the azure web application.
More details, you could refer to below steps.
1.Open the KUDU console in your web app.
2.CLick CMD console and local the wwwrot folder
3.Add new folder and upload the node_modules folder.
Restart the application, them your project will work well.
Since your project isn't as same as the github projects, if you still get the mistake.
I suggest you could change the application setting as below to see the details error message.
1.Open application setting in your web service portal.
2.Add Hosting:Environment as below:
Besides, I suggest you could check your web application's connection string. Azure web app couldn't connect to the local server if you don't use Hybrid connections.
I suggest you could create a azure sql server and change the connection string as azure sql server's connection string.

While Debugging in VS, can I change the HTTP Header server tag?

I have an MVC project that I've written and tested in VS 2013. When I test and debug the application from Visual Studio, my application has rendered correctly. However, when I published my application to it's hosting server, the page isn't rendering and styling correctly from the server.
Upon inspecting the page source and headers, the only difference that I found is that in Visual Studio, IIS Express is passing the HTTP header property:
Server: Microsoft-IIS/10.0
However, on the server that I published to, the server outputs:
Server: Microsoft-IIS/8.5
I am not sure if this is the cause of my root problem but I need to be able to locally duplicate this scenario so that I can take the results to my sysadmin who manages the server.
Is there a way that I can fudge this HTTP header property?
For clarification, this is an MVC5 application, targeting .Net 4.5.2 and the server that I am publishing to is running Windows Server 2012.

Connecting between IIS Express and Jetty on Azure Cloud Service Virtual Machine

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.

Delphi 2010 DataSnap Client with HTTPS

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.

Resources