IIS가없는 서버에서 호스트되며 인증없이 일반인이 액세스 할 수있는 tcp wcf 서비스를 만들려고합니다.공용 WCF 서비스를 호스팅하는 방법은 무엇입니까?
ServiceHost svh = new ServiceHost(typeof(MyService));
var tcpbinding = new NetTcpBinding(SecurityMode.None);
var location = "net.tcp://localhost:11111";
svh.AddServiceEndpoint(typeof(IMyService), tcpbinding, location);
svh.Open();
....
서비스는 locashost에 잘 작동하지만 내가 (방화벽 예외 추가) 서버를 설정할 때, 클라이언트는 메시지와 함께 충돌 :
The socket connection was aborted. This could be caused by an error processing
your message or a receive timeout being exceeded by the remote host, or an
underlying network resource issue. Local socket timeout was '00:00:59.7344663'.
여기
내가 할 것입니다
나는이에 대한 변경해야합니까
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IMyService">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://myserver:11111/"
binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IMyService"
contract="MyServer.IMyService" name="NetTcpBinding_IMyService" />
</client>
</system.serviceModel>
</configuration>
작동하려면 :
다음은 클라이언트 구성 파일입니까?
당신은 http://msdn.microsoft.com/en-us/library/bb332338.aspx을 읽어나요? –