I have a IIS configured with a lot of websites. Now I want to install a WebApi hosted with OWIN/Katana in a Windows Service (using topshelf). Could my WebApi be using the same port as IIS?
Will this work? What if I use the same name - who wins?
Thanks for any help - I'm a bit confused here.
Larsi
Theoretically it's possible to do it.
Windows allows to reserve URLs for different services, so that they can listen on a particular url. Once the reservations are done, and the applications start listening for requests, the HTTP Server API routes the incoming requests to the different services. Here is an explanation on how that happens:
With Web API it's very easy to setup the service to listen on a concrete URL, and will not interfere with the routing of other URLs.
The problem is in IIS. IIS only allows you to setup a site on a root URL, instead on a concrete URL path. There is no concrete documentation on how this reservation is done. But you can see it your self using netsh:
netsh
netsh>
prompthttp
. The prompr should now read netsh http>
show urlacl
This will show you the complete list of URL reservations for all the services in the machine. NOTE, you can dump the output to a file running this from the command line: netsh http show urlacl > c:\users\jotabe\documents\urlacls.txt
With all this information you can setup IIS and a Web API service, check the registrations created by them, and, according to the rules on the linked document seeif what you want to do will work or not.