Registration of Base Addesses
HTTP namespace sharing allows you to build different pieces of your web site using different technologies. For instance, some parts of your content may be static pages or ASP.NET pages while other parts of your content may be web services. It would be really inconvenient if each technology had to be run in its own server on a different port or with a different host name. These sorts of things pretty much work out of the box now thanks to some improvements made in Windows Server 2003. Except when they suddenly stop working, which is really frustrating.
Here's an average example of namespace sharing. IIS has grabbed the root path and some of its content is off in a subpath. There's a WCF service running in a different subpath and that service may not even be hosted in IIS. For instance, it could just be a standalone web service always running on the machine. The WCF service has a couple of endpoints and all of this configures nicely.
The problem starts when you look at the different ways you could have configured that WCF service. If you have a base address of S1 for the service host, then the service endpoint is at the service root path and the metadata endpoint is in a subpath. This works fine. Then, you change the configuration so that the base address is the root path. The service endpoint is at the S1 subpath and the metadata endpoint is in a subpath farther down. Now, everything breaks.
What has happened is that WCF makes a reservation for the base address of the service so that it can see all of the requests coming in to that part of the namespace. However, I told you way back at the beginning that IIS has already grabbed the root path for its own purposes. That's not going to work. Actually, it does work because WCF takes the namespace more forcefully than IIS, but either way some part of your web site is now hosed. This is why it actually matters how you specify addresses in terms of base and relative paths. The same thing can happen between two WCF services even when IIS is not in the picture. However, in that case you'd get an exception starting the second service because they're both fighting equally hard for the reservation.
Next time: Overriding the Default Configuration File
Comments
- Anonymous
December 01, 2006
The HTTP transport and binding element have three settings for controlling the proxy behavior. public