Showing posts with label wcf 4.0. Show all posts
Showing posts with label wcf 4.0. Show all posts

How to host wcf service in IIS using Tcp protocol

In this post I am going to show you how to host WCF service in IIS using TCP protocol.By default, the TCP WCF activation service is not enabled on your machine. You can follow these steps to enable the TCP activation for WCF services:
  1. Go to Control Panel | Programs | Turn Windows features on or off.
  2. Expand the Microsoft .Net Framework 3.5.1 node on Windows 7
  3. Check the checkbox for Windows Communication Foundation Non-HTTP Activation on Windows 7
getfile
Next,Create the IIS application to host the WCF application using TCP protocol.Follow these steps
  1. Open run command and type inetmgr
  2. Create a new application and point to physical folder.
  3. Select the DefaultAppPoll  and make sure your default app pool is a .NET 4.0.X application pool.
  4. Right-click on web application, select Manage Application | Advanced Settings, and then add net.tcp to Enabled Protocols.(Make sure you use all lowercase letters and separate it from the existing HTTP protocol with a comma)
image
Now the service is hosted in IIS using the TCP protocol.

How to change default binding in wcf 4.0

In this post I will share a very handy tips for wcf 4.0.As we all know that default binding is a new feature introduced in wcf 4.0.With WCF 4, this is no longer the case because the runtime automatically adds one or more "default endpoints" for you, thereby making the service usable without any configuration.
<protocolMapping>
      <add binding="wsHttpBinding" scheme="http"/>
    </protocolMapping>