Blog from Saravanan Arumugam

Let us talk about Technologies

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>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: