WCF 서비스와 통신하는 클라이언트 콘솔 앱이 있는데 다음 오류가 발생합니다. "서버가 의미있는 응답을 제공하지 않았습니다. 계약 불일치, 세션 종료 또는 내부 서버 오류. "WCF 계약 불일치 문제
계약 불일치로 인한 것 같지만 그 이유를 알 수 없습니다. 이 서비스는 자체적으로 잘 실행되며 가장 부분 코드를 추가 할 때까지 두 부분이 함께 작동합니다.
누구나 잘못된 것을 볼 수 있습니까? WCF 서비스의 구성 파일을 여기
NetTcpBinding binding = new NetTcpBinding();
binding.Security.Mode = SecurityMode.Message;
binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows;
EndpointAddress endPoint = new EndpointAddress(new Uri("net.tcp://serverName:9990/TestService1"));
ChannelFactory<IService1> channel = new ChannelFactory<IService1>(binding, endPoint);
channel.Credentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;
IService1 service = channel.CreateChannel();
을 그리고있다 : 여기
클라이언트, 모든 코드에서 이루어집니다<configuration>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="MyBinding">
<security mode="Message">
<transport clientCredentialType="Windows"/>
<message clientCredentialType="Windows" />
</security>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="WCFTest.ConsoleHost2.Service1Behavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceAuthorization impersonateCallerForAllOperations="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="WCFTest.ConsoleHost2.Service1Behavior"
name="WCFTest.ConsoleHost2.Service1">
<endpoint address="" binding="wsHttpBinding" contract="WCFTest.ConsoleHost2.IService1">
<identity>
<dns value="" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<endpoint binding="netTcpBinding" bindingConfiguration="MyBinding"
contract="WCFTest.ConsoleHost2.IService1" />
<host>
<baseAddresses>
<add baseAddress="http://serverName:9999/TestService1/" />
<add baseAddress="net.tcp://serverName:9990/TestService1/" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>
예, 아마 다음은
내가 문제를 해결 도움이 코드 조각입니다 인터넷 서버 오류." –