patmap Posted January 30, 2012 Posted January 30, 2012 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. Best Regards Quote
Administrators Farshad Mohajeri Posted January 30, 2012 Administrators Posted January 30, 2012 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. Quote
patmap Posted January 30, 2012 Author Posted January 30, 2012 Hi, Mr. Farshad I debug with Firebug and i see server send this request every 1 sec: http://handleevent/ I think must be send : http://MyDomain/handleevent/ Best Regards Quote
Administrators Farshad Mohajeri Posted January 30, 2012 Administrators Posted January 30, 2012 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. Quote
patmap Posted January 30, 2012 Author Posted January 30, 2012 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 Quote
Administrators Farshad Mohajeri Posted January 30, 2012 Administrators Posted January 30, 2012 How did you map your URL to ISAPI module? Quote
patmap Posted January 30, 2012 Author Posted January 30, 2012 Hi, Mr. Farshad My Definition: I set( *. ) in Request path ! Best Regards Quote
Administrators Farshad Mohajeri Posted January 30, 2012 Administrators Posted January 30, 2012 Have you tried first using a regular URL? something like: http://myserver/myvirtualdir/myapp.dll Quote
Administrators Farshad Mohajeri Posted January 30, 2012 Administrators Posted January 30, 2012 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 My Definition: I set( *. ) in Request path ! Best Regards Quote
patmap Posted January 30, 2012 Author Posted January 30, 2012 Hi, Mr. Farshad I Set http://MyServer/GeoTracker.dll and this work. (You can see my demo site) Now, if i want to use http://MyServer/ can solve this problem ? Best Regards Quote
patmap Posted January 30, 2012 Author Posted January 30, 2012 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 Quote
Administrators Farshad Mohajeri Posted January 30, 2012 Administrators Posted January 30, 2012 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. Quote
patmap Posted January 30, 2012 Author Posted January 30, 2012 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 Quote
Administrators Farshad Mohajeri Posted January 30, 2012 Administrators Posted January 30, 2012 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. 1 Quote
Administrators Farshad Mohajeri Posted January 30, 2012 Administrators Posted January 30, 2012 I succeeded this: http://canvas.unigui.com/ see image 1 Quote
patmap Posted January 30, 2012 Author Posted January 30, 2012 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 Quote
patmap Posted January 30, 2012 Author Posted January 30, 2012 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 Quote
patmap Posted January 30, 2012 Author Posted January 30, 2012 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 Quote
Administrators Farshad Mohajeri Posted January 30, 2012 Administrators Posted January 30, 2012 OK I will check to see if there is something missing in the url parsing logic. Thanks 1 Quote
patmap Posted January 30, 2012 Author Posted January 30, 2012 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.