Matt W
Matt W

Reputation: 323

WCF Won't Host in IIS

I've created my service as a WCF Service Application. I've then published the service to a folder called "TestService". I'm trying to add it as a site to IIS Manager. Everything seems to go fine until I go to browse to the service I am always greeted with:

HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.

I'm browsing to this at http://localhost:8734 and the website is hosted in IIS at port 8734. The web.config has the following too:

<service behaviorConfiguration="TestServiceBehavior" name="TestApp.Service.TestService">
<endpoint address="/Authentication" binding="wsHttpBinding" bindingConfiguration="TestServiceBinding"
      contract="TestApp.Service.IAuthenticationService" />

// ... other endpoints

<host>
  <baseAddresses>
    <add baseAddress="http://localhost:8734/Design_Time_Addresses/TestApp.Service/Service1/" />
  </baseAddresses>
</host>

Any help would be appreciated.

Upvotes: 1

Views: 82

Answers (1)

Matt Cole
Matt Cole

Reputation: 2601

The service is hosted, you need to browse to the service endpoint eg http://localhost:8734/MyService.svc. The reason you are getting a 403 is because you are trying to browse the directory in which the application is deployed, and this is normally not allowed. You can turn directory browsing on with a web.config setting.

Upvotes: 1

Related Questions