Firewall blocking wcf lan client
I have hosted my WCF windows service on WINDOWS 7 OS and have client application on win开发者_运维百科dows-XP PC. WIN-7 firewall is blocking my XP client app, when I disabled firewall on Win-7, client app is working nicely. how I can overcome this problem. I am using security mode="none" for all lan based client app.
Client side config file
<system.serviceModel>
<bindings>
<netNamedPipeBinding>
<binding name="NetNamedPipeBinding_IDataService" >
<security mode="Transport">
<transport protectionLevel="EncryptAndSign" />
</security>
</binding>
</netNamedPipeBinding>
<netTcpBinding>
<binding name="NetTcpBinding_IDataService">
<security mode="None">
</security>
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://localhost:8523/DataServices" binding="netTcpBinding"
bindingConfiguration="NetTcpBinding_IDataService" contract="DataServiceReference.IDataService"
name="NetTcpBinding_IDataService" />
<endpoint address="net.pipe://localhost/" binding="netNamedPipeBinding"
bindingConfiguration="NetNamedPipeBinding_IDataService" contract="DataServiceReference.IDataService"
name="NetNamedPipeBinding_IDataService">
</endpoint>
</client>
</system.serviceModel>
Or, you can add/enable Windows Communication Foundation Net.TCP Listener Adapter (TCP-In) in Inbound Rules in Windows Firewall with Advanced Security
You do not need to disable firewall. Your config has 2 endpoints defined here. While net.tcp would be blocked by firewall, net.pipe would not be affected. So just use NetNamedPipeBinding_IDataService endpoint in your clients.
If for some reason this is not working or client is not on the same domain (extent of net.pipe) you can use wsHttpBinding or even simpler basicHttpBinding. This would use Http over port 80 which is most likely open if your server has IIS installed.
You overcome the problem by disabling the firewall. There is nothing you can do within the WCF config that can get round a firewall on the host machine. If the port you bind to is blocked then no data will ever reach the end point.
精彩评论