Today while doing a bit of refactoring to some of our WCF code I started getting the following error
e.Message
"The ChannelDispatcher at 'http://localhost:9997/ServiceNameHere/ServiceHere' with contract(s) '\"IService\"' is unable to open its IChannelListener."
e.InnerException.Message
"Unable to start the HTTP listener. The URI provided, 'http://localhost:9997/ServiceNameHere/ServiceHere', is invalid for listening. Check the base address of your service and verify that it is a valid URI."
When I first got this it made no sense to me at all, this code had just worked a few minutes go. A quick google search helped a little, but I was not able to find a post that talked to my exact question. However, I did run across a post that lead me to my issue.
The issue here was NOT in the service setup or config setup (mostly), but rather in the port that was being used in the service address. You see I am trying to use port 9997 and turns out this is already in use by another one of my services (issue came up while refactoring how we store our service inventory information). As soon as I switched to use another port (9998) the world was a better place.
So, if you ever find yourself getting the errors above do yourself a favor and make sure the port that is in the url is not already being used.
Till next time,
Posted
12-10-2009 12:18 PM
by
Derik Whittaker