1
votes

My basic question is for guidance hosting a WCF service in IIS7 (2008 R2) on the default net.tcp port of 808 on a website other than "Default Web Site". I have 4 sites each bound to a specific IP address. I would like my WCF services to be hosted within a site other than the default using port 808. What is the catch here? I want to understand this without just using another port to solve the issue if that would even be the case.

I created this running question/log of trying to figure this out yesterday, but I just didn't have much luck. I had to move the WCF services back to the default website and move the net.tcp binding from my desired website back to the default as well.

moved net.tcp WCF services from localhost to IP address on new site, services won't load

I access my services using the technique of:

MyServiceClient : ClientBase<IMyService>, IMyDataService

and within the methods of the client:

return base.Channel.MyOperation(request);

I rely on the WCF configs in web.config of the hosting projects providing the .svc file to properly connect me to the WCF services. If this is sub-optimal, I am willing to change.

A typical client configuration in web.config looks as such:

<endpoint name="myServiceClient" address="net.tcp://localhost/MyServiceWebHost/MyService.svc/tcpEndpoint"  binding="netTcpBinding" bindingConfiguration="myServiceNetTcpBinding"  contract="Contracts.ServiceContracts.IMyService" />

Thanks for any pointers.

1

1 Answers

0
votes

Its rights issue. Right click on your new website --> then Edit Permissions. On properties window click security tab and Edit button. Then Add IIS_IUSRS and give Read & execute, List folder contents, Read permissions. Now you can host and connect net tcp on new website.