jump to navigation

How to configure WAS for TCP endpoints in IIS March 5, 2012

Posted by fofo in C#, Visual Studio 2008, Visual Studio 2010, WCF, WCF Service.
Tags: ,
trackback

In this post I would like to show you how to activate Windows Activation Services or WAS for TCP based activation.What this means is that it is possible to host WCF Services in IIS and expose TCP endpoints. Recently I have posted 3 posts on WCF hosting options. You can find them here , here and here.

1) We need to create our WCF Service first.We will use the exact same example we used when we hosted a WCF Service in IIS (full version) .Click here to see this post. You have to follow all the steps as they were described in that post. After you finish all the steps in that post you will have successfully hosted a WCF Service in IIS.

2) I will show you how to install WAS in your machine.Go to the Control Panel–> Program and Features and select Turn Windows features on or off.Then you need to select some options/components to install. Have a look at the picture below to see what those options are

3) Now I need to run some commands to enable TCP and other protocols on the Default Web Site. I will do that using the appcmd command.Open a Visual Studio 2010 command prompt as an administrator and browse to this folder C:\Windows\System32\inetsrv. Then type appcmd.exe set site “Default Web Site” -+bindings.[protocol=’net.tcp’,bindingInformation=’808:*’] and hit Enter.Then in the new command prompt type appcmd.exe set site “Default Web Site” -+bindings.[protocol=’net.pipe’,bindingInformation=’*’] and hit Enter. Then in the new command prompt type appcmd.exe set site “Default Web Site” -+bindings.[protocol=’net.msmq’,bindingInformation=’localhost’]

Hopefully these commands will execute successfully and these protocols are enabled on the Default Web Site.Now we need to enable those protocols on the CalculatorServiceSite website that hosts our WCF service.In the same Visual Studio 2010 command prompt window type

appcmd.exe set app “Default Web Site/CalculatorServiceSite /enabledProtocols:http,net.pipe,net.tcp,net.msmq

Now we have enabled those protocols for our site.Now we are ready to expose endpoints over alternate protocols e.g TCP,MSMQ. In this way we can have our WCF Service hosted in IIS and still consume it over the network with clients that support/understand the TCP/IP protocol.

Hope it helps!!!

Comments»

1. Dot Net Rules : How to configure WAS for TCP endpoints in IIS - March 5, 2012

[…] this means is that it is possible to host WCF Services in IIS and expose TCP endpoints. (read more) Share Posted: Δευτέρα, 5 Μαρτίου 2012 2:18 πμ από το μέλος […]

2. 4 be 4 - March 7, 2012

You need to be a part of a contest for one of the most useful blogs on the
internet. I most certainly will recommend this blog!

3. Partha - November 2, 2012

Hi, thank you for this post, I have one WCF service which has TCP endpoints, this service again communciating with other services. in this case, how i can host those services as a part of this main service.
thank you in advance,
kind Regards,
-Partha


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: