CodePudding user response:
Will and iis 6 completely different,,,Cgi mode isapi under will how all not line, finally had to switch to run apache isapi,,,,
CodePudding user response:
I also encountered this kind of situation, six years ago with Delphi7 wrote a cgi as webService, server environment at that time is a 32-bit Windows 2003, IIS is 6.0, of course, the server upgrade now, instead of a 64 - bit Windows 2008, IIS is 7.5, the deployment of the past just can't run, the error is:=========================================================================
HTTP error 502.2 - Bad Gateway
The specified CGI application because the returns a complete set of HTTP headers and produce error behavior, it is the head of the actual return "Exception EInOutError in module TestService_D7. Exe at 00036 FBC. I/O error 6.",
=========================================================================
I think there are two solution:
1. If you have the source code, Delphi7 to Delphi XE to compile, but the Delphi7 cgi USES some third party controls, want to consider to have adapted version,
2. If there is no source code, is to switch to the Apache to run cgi, but my the webService USES ado to connect to the database, there is no question of 32-bit server, a 64 - bit server could not find the DLL ado related, so also won't work, if you have the source code, can replace ado all with UniDAC controls to connect to the database, this compilation,
But I heard that a player is solved Delphi7, cgi, will x64 problems, but I don't know how to solve, is estimated to be in HTTPSoapDispatcher HTTPSoapPascalInvoker, WSDLHTMLPublish to inside,
CodePudding user response:
Will finally find the answer on https://serverfault.com/questions/130423/run-cgi-in-iis-7-to-work-with-get-without-requiring-post-request, CGIApp Run part of the code can be modified,Procedure TCGIApplication. Run;
Var
The HTTPRequest: TCGIRequest;
HTTPResponse: TCGIResponse;
The begin
Inherited the Run;
If IsConsole then
The begin
Rewrite (Output);
///Win 7/2008 will
//Reset (Input);
{$I -} {!!!!! Will}
Reset (Input);
If IOResult & lt;> 0 then;
{$I +}
///\ \ \
end;
Try
The HTTPRequest:=NewRequest;
Try
HTTPResponse:=NewResponse (HTTPRequest);
Try
HandleRequest (HTTPRequest, HTTPResponse);
The finally
HTTPResponse. Free;
end;
The finally
The HTTPRequest. Free;
end;
Except,
HandleServerException (ExceptObject FOutputFileName);
end;
end;
Comments in blue, add red,
, of course, I opened the XE8 find corresponding part, copy the its code to come over, and then compile, also can,
Procedure TCGIApplication. Run;
Var
The HTTPRequest: TCGIRequest;
HTTPResponse: TCGIResponse;
The begin
Inherited the Run;
If IsConsole then
The begin
Rewrite (Output);
end;
Try
The HTTPRequest:=NewRequest;
If the HTTPRequest. ContentLength & gt; 0 then
The begin
If IsConsole then
Reset (Input);
//Read the post data.
The HTTPRequest. ReadString (1);
end;
Try
HTTPResponse:=NewResponse (HTTPRequest);
Try
HandleRequest (HTTPRequest, HTTPResponse);
The finally
HTTPResponse. Free;
end;
The finally
The HTTPRequest. Free;
end;
Except,
HandleServerException (ExceptObject FOutputFileName);
end;
end;
CodePudding user response:
In order not to reinstall or switch machine, makes the revision is restored, proposed to CGIApp. Pas kao to your project directory, and added to the project, so as not to back to a mystery,CodePudding user response: