Blog from Saravanan Arumugam

Let us talk about Technologies

Monthly Archives: November 2010

Minimum Configuration Required for hosting a WCF service in IIS


For a service to work in IIS, the default Address, Binding and Contract specifications are fair enough if it is a simple service with no security.

 

The end point is the address of the web site followed by the .svc file name.

e.g. http://localhost:12345/TaskManagerService.svc

Reference: Default end point of WCF service.

The default binding is the basicHTTPBinding.

Contract is specified in the .svc file

 

However, the service metadata (WSDL) download (using Get method) is not enabled by default. The consumer of the service would require this WSDL for communication.

So the following minimum code need to be added in the web.config file.

<system.serviceModel>
  <behaviors>
    <serviceBehaviors>
      <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
      </behavior>
    </serviceBehaviors>
  </behaviors>
</system.serviceModel>