views:

4260

answers:

2

I'm trying to publish a calculation service on a bunch of computers which will be used by an application server. The calculation servers are stateful and need to be able to perform asynchronous callbacks so I want to use per-session settings via TCP.

The service application was built using the WCF Service Application project type in VS2008.

As it happens the calculation service machines are running Vista, so according to the documentation I've read I should be able to use WAS hosting. I am trying to follow Microsoft's instructions on the subject:

Install and configure WCF components

Host a WCF service in WAS

But I am running into trouble early. I am supposed to put the .svc file in my application's virtual directory. But since I am not using IIS hosting, how do I create the virtual directory? The docs above are not clear on this.

Also, when trying to run the command which allows net.tcp access to my application:

%windir%\system32\inetsrv\appcmd.exe set app "Default Web Site/<WCF Application>" /enabledProtocols:net.tcp

I don't know what to replace <WCF Application> with. Again, there seems to be a prior step missing where one publishes the service in an 'IIS hosted-like' manner.

I've created a test application which tries to consume the service. When I click "Add Service Reference" it discovers my service but can't connect to it using net.tcp.

Has anyone here succeeded in WAS hosting and consuming a service? Do you have any pointers for me?

UPDATE: I've now tried to add net.tcp bindings to the website using IIS Manager (right click -> Edit bindings...) but the only protocols available in the Add... dialog are http and https. No net.tcp in that list. And yes, I have installed Non-http Activation components... Very strange.

+1  A: 

Since WAS is part of the IIS architecture, you need to create a virtual directory in an IIS website (for example 'Default Web Site') that points to physical location of the WCF service you are hosting. Then you will have to create an application on that virtual directory, like you would for an ASP.NET website, or an ASMX web service.
You can easily do this by using IIS 7's management console.

You can read the details about how WAS works in IIS7 here.
For a more step-by-step guide to WAS hosting have a look at this article.

Enrico Campidoglio
Thanks, I did do this using the IIS manager. However, net.tcp is not available in the Edit Bindings dialog. I don't understand why since I have added non-http activation.
d91-jal
A: 

You need to add the net.tcp binding to the binding of the application in IIS.

Right click the virtual directory/application in IIS -> Manage application -> Advanced settings.

In the Enabled Protocols part just add net.tcp and voila!!

Boris