【发布时间】:2009-04-22 15:38:56
【问题描述】:
我有一个 WCF 服务和一个 Windows 客户端。它们通过双工 WCF 通道进行通信,当我从单个网络域中运行时,该通道运行良好,但是当我将服务器放在单独的网络域上时,我在 WCF 服务器跟踪中收到以下消息...
带有to的消息
'net.tcp://abc:8731/ActiveAreaService/mex/mex' 无法在接收方处理, 由于 AddressFilter 不匹配 端点调度程序。检查 发送者和接收者的 EndpointAddresses 同意。
因此,如果组件位于两个单独的域中,则通信似乎只能在一个方向(从客户端到服务器)进行。
网络域是完全受信任的,所以我有点困惑,还有什么可能导致这种情况?
服务器 app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="JobController.ActiveAreaBehavior">
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="JobController.ActiveAreaBehavior"
name="JobController.ActiveAreaServer">
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://SERVER:8731/ActiveAreaService/" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>
但我也在 Visual C++ 中以编程方式添加了一个端点
host = gcnew ServiceHost(ActiveAreaServer::typeid);
NetTcpBinding^ binding = gcnew NetTcpBinding();
binding->MaxBufferSize = Int32::MaxValue;
binding->MaxReceivedMessageSize = Int32::MaxValue;
binding->ReceiveTimeout = TimeSpan::MaxValue;
binding->Security->Mode = SecurityMode::Transport;
binding->Security->Transport->ClientCredentialType = TcpClientCredentialType::Windows;
ServiceEndpoint^ ep = host->AddServiceEndpoint(IActiveAreaServer::typeid, binding, String::Empty); // Use the base address
客户端 app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IActiveAreaServer" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10"
maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://SERVER:8731/ActiveAreaService/"
binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IActiveAreaServer"
contract="ActiveArea.IActiveAreaServer" name="NetTcpBinding_IActiveAreaServer">
<identity>
<userPrincipalName value="user@SERVERDOMIAIN.CLIENTDOMAIN.COM" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
感谢任何帮助!
干杯
【问题讨论】: