Jump to content

ISAPI Server unavailable Problem


patmap

Recommended Posts

  • Administrators

Hi Mr. Farshad

 

I want to use ISAPI project but always show me "Server unavailable, please try later".

 

Can you tell me where is my problem, please.

 

I can't say much with this limited information, but perhaps your session crashes before it can send anything to the client. See Log file for any error log.

Link to comment
Share on other sites

  • Administrators

Hi, Mr. Farshad

 

I debug with Firebug and i see server send this request every 1 sec:

 

 

Requests come from client not server. I need more info. You can start with a basic project with a blank form and adding features until problem starts.

 

Most of ISAPI issues come from access to system resources which are not accessible from IIS built-in account.

Link to comment
Share on other sites

Requests come from client not server. I need more info. You can start with a basic project with a blank form and adding features until problem starts.

 

Most of ISAPI issues come from access to system resources which are not accessible from IIS built-in account.

 

Hi, Mr. Farshad

 

I start with basic project and send PM message to you my demo site.

 

Best Regards

Link to comment
Share on other sites

AFAICT, this way of mapping is not correct. You must first setup a regular URL for your ISAPI module then use Url-Rewriting to redirect it to a user-friendly URL.

 

 

 

Hi, Mr. farshad

 

I did not define any rewrite url !

Only i map my dll with *. or * just this !

 

 

Best Regards

Link to comment
Share on other sites

  • Administrators

Hi, Mr. farshad

 

I did not define any rewrite url !

 

You must use url rewrite to map your ISAPI module to a different URL. First if not already installed, you must install url rewrite module into IIS.

 

I'm not an expert in url rewriting. You must look at resources in web for proper rules you need to redirect your DLL to a URL.

Link to comment
Share on other sites

Hi, Mr. Farshad

 

But i think this request have a problem :

 

HandleEvent used in htt*://myserver/GeoTracker.dll/HandleEvent

 

I think HandleEvent request added into end of ScriptName of URL and it seem must be added in Full URL(Protocol + Host + ScriptName )

 

So, This is a opinion.

 

Thank you.

 

Best Regards

Link to comment
Share on other sites

  • Administrators

Hi, Mr. Farshad

 

But i think this request have a problem :

 

HandleEvent used in htt*://myserver/GeoTracker.dll/HandleEvent

 

I think HandleEvent request added into end of ScriptName of URL and it seem must be added in Full URL(Protocol + Host + ScriptName )

 

Yes, Script Name is missing here as a result of improper URL.

  • Upvote 1
Link to comment
Share on other sites

Hi Mr. Farshad

 

This is very good. Thanks. you use a rewrite url.

 

But i think this is not a professional job ! all your request send with DLL (See attach.)

 

I found this problem resource:

 

In this ExtPascal.pas unit and Line 659 ( TIdExtSession.MethodURI ) this is a Wrong way for relative path of url.

i change this ( for Temporarily. because must me support https too )

 

Result := 'Http://' + FCurrentRequest.Host + Query['SCRIPT_NAME'] + AMethodName;

 

Can you test it ?

 

Best Regards

post-224-0-84552700-1327945191_thumb.png

Link to comment
Share on other sites

Hi. Mr. Farshad

 

I test it and work perfect. you can see my demo site.

 

but this not work for GeoTrack.DLL module or for this

 

http://canvas.unigui.com/canvas.dll

 

we must be check if Query['SCRIPT_NAME'] = '' then we use this line

 

Result := 'http://' + FCurrentRequest.Host + Query['SCRIPT_NAME'] + AMethodName;

 

else

 

Result := Query['SCRIPT_NAME'] + AMethodName;

 

 

Best Regards

Link to comment
Share on other sites

Hi Mr. Farshad

 

I change this method and i test it with MyDLL.DLL script name and without MyDLL.DLL and it work good .

 


function TIdExtSession.MethodURI(AMethodName : string) : string;
var Protocol: String ;
begin
 if AMethodName[1] <> '/' then AMethodName := '/' + AMethodName;
 if (Query['SCRIPT_NAME'] = '' ) or (Query['SCRIPT_NAME'] = '/') then
 Begin
Protocol := 'http://' ;
If Pos('HTTPS',  FCurrentRequest.RawHTTPCommand) > 0 Then
 	Protocol := 'https://' ;
 	Result := Protocol + FCurrentRequest.Host + StringReplace('/' + Query['SCRIPT_NAME'] + AMethodName, '//' , '/', [rfReplaceAll]);
 End
 Else
Result := Query['SCRIPT_NAME'] + AMethodName;

end;

 

Best Regards

Link to comment
Share on other sites

Hi Mr. Farshad

 

I test this functionality many many time, and some times in ISAPI mode Query['SCRIPT_NAME'] equal with AMethodName and cause a same problem,

I change this function source, and test it with VCL mode and ISAPI mode and it seem no problem,

 

function TIdExtSession.MethodURI(AMethodName : string) : string;
var Protocol: String ;
ScriptName: String;
begin
 ScriptName := StringReplace( Query['SCRIPT_NAME'], '/', '', [rfReplaceAll]);
 if (ScriptName = AMethodName) or (ScriptName = '' )then
 Begin
Protocol := 'http://' ;
If Pos('HTTPS',  FCurrentRequest.RawHTTPCommand) > 0 Then Protocol := 'https://' ;
Result := Protocol + StringReplace( FCurrentRequest.Host + '/' + AMethodName, '//', '/', [rfReplaceAll]) ;
 End
 Else
Result := StringReplace( Query['SCRIPT_NAME'] + '/' + AMethodName, '//', '/', [rfReplaceAll] );
end;

 

Best Regards

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...