You are not logged in.
I used examples 09 - HttpApi web server wrote a small application and found that as long as the use of the port, IIS can not be used, do not know why, please help me, thank you
constructor TPubRestServer.Create(const Path: TFileName;ListenPort: string);
begin
FListenPort := ListenPort;
fServer := THttpApiServer.Create(false);
fServer.AddUrl('',FListenPort,false,'+',true);
fServer.RegisterCompress(CompressGZip);
fServer.OnRequest := Process;
fPath := IncludeTrailingPathDelimiter(Path);
FIRSQL := TServiceRemoteSQL.Create;
FPostRequestCount := 0;
FGetRequestCount := 0;
end;
destructor TPubRestServer.Destroy;
begin
fServer.Free;
inherited;
end;
Offline
Try use a different port other than the one (80 by default) used by ISS.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
THttpApiServer monitor which port, which port IIS can not be used, I have tested the three ports, and do not know how to lift the restrictions, not been listening to the port THttpApiServer, are normal
Offline
THttpApiServer internally uses http.sys to facilitate listening, IIS also uses http.sys so it's possible for both of them to use same port and at the same time, you only need to make sure they are registered with unique urls.
Note that you need to have admin rights to register your app within http.sys, you only need to do it once (during setup or later if you change your url).
For example, I have this within my create method:
FRegisteringMode := SameText(ParamStr(1), '/register'); // check if /register argument is passed to app
FServer.AddUrl('root', IntToStr(PrgSettings.ListeningPort), False, '+', FRegisteringMode);
Once I need to install it on a new computer I start admin cmd prompt, go to my app dir and write MyApp.exe /register;
To check if your app is registered you can use simple app at https://httpsysconfig.codeplex.com or you can write "netsh http show urlacl" at command line.
If all is OK, you'll be able to see results when you visit
http://127.0.0.1:MyListeningPort/root
In your example, you're calling addUrl with no url specified, so that might be the problem (if IIS is registered the same way), try something else or unregister IIS.
Offline
First of all to thank you for your suggestions, using the http.sysconfig tool and found that there are a lot of used url, if you remove these URLs, IIS can use these ports, and there is no way out in the APP when removed These URLs, can give advice, very grateful
Offline
First of all to thank you for your suggestions, using the http.sysconfig tool and found that there are a lot of used url, if you remove these URLs, IIS can use these ports, and there is no way out in the APP when removed These URLs, can give advice, very grateful
Sorry, didn't understand, have you got it working or not? If not what is actually happening and what urls are you using and are they registered?
Offline