views:

9

answers:

1

Hi All,
I have a IIS hosted service http://localhost/someProject/services/myservice.svc . Is it possible to somehow make say http://locahost:9705 point to it? How do I set this up? It seems to be pretty straightforward with a Windows Service hosted WCF service, but I cannot figure how to accomplish this when using .svc files and IIS. In the app.config of a Windows Service I just add a host node...

<host>
  <baseAddresses>
   <add baseAddress="net.tcp://localhost:9705"/>
  </baseAddresses>
</host>

however when I do the same thing in an IIS hosted svc web.config

<host>
  <baseAddresses>
     <add baseAddress="http://localhost:9705"/&gt;
  </baseAddresses>
</host>

I browse to http://localhost:9705 and I get an IE error cannot display the webpage etc... In the windows hosted services I'm able to browse to the page, although not in this example as I'm using net.tcp, but with other services, it works. What am I doing wrong here? Is this even possible? Please point me in the right direction. Thanks for any tips and/or help.

Cheers,
~ck in San Diego

A: 

If you host in IIS, it's IIS that controls where the service is located. You cannot override the IIS settings - if your *.svc file is located under http://localhost/someproject/services/myservice.svc, then that's your service address. Any <baseAddress> settings in your web.config file are ignored and useless.

So either you can configure this in IIS, or you have to switch to self-hosting your WCF service in e.g. a Windows Service or a console app or something.

marc_s
Any idea how I can set this up in IIS? I would like to try that approach.
Hcabnettek
Check out www.iis.net - there's a "Learn IIS Configuration" link on the homepage
marc_s