【发布时间】:2012-04-27 08:59:08
【问题描述】:
我有一个服务器/客户端应用程序,其中服务器托管在 IIS 服务器中,许多客户端将连接到该 IIS 服务器,双重绑定用于从服务器向客户端广播消息。
我在没有错误的 Vista 机器上开发,但是当我们在使用 Windows 7 的客户端 PC 上测试客户端应用程序时,出现错误。
我第一次遇到这个错误:
HTTP 无法注册 URL http://+:80/Temporary_Listen_Addresses/cc6f2e30-ff08-4bfc-8397-d67630337a9c/ 因为另一个应用程序正在使用 TCP 端口 80。例外 在主 UI 线程 1 上处理。
根据来自互联网的解决方案,我在客户端配置文件中添加了一个 clientBaseAddress(没有更改并且从不在服务器配置中添加 clientBaseAddress),现在我收到第二个错误:
HTTP 无法注册 URL http://+:91/NightlyBuild/NonVer/Communication/。您的 进程没有访问此命名空间的权限(请参阅 http://go.microsoft.com/fwlink/?LinkId=70353 了解详情)。例外 在主 UI 线程 1 上处理。
好的,我发现一些cmets说需要以管理员模式运行客户端应用程序,我也是这样做的,我没有收到前两个错误,但是这次我在屏幕冻结5分钟后出现超时错误。
超时错误
打开操作未在分配的超时时间内完成 00:05:00。分配给此操作的时间可能是一部分 更长的超时时间。在主 UI 线程 1 上处理异常。
下面是我遇到第二个错误时使用的客户端配置。
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_ICommunicationService"
closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:05:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="0" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
clientBaseAddress="http://remote-server:8001/Communication/">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<!--<security mode="Message">
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
</security>-->
<security mode="None" />
</binding>
客户端配置中的端点:
<client>
<endpoint address="http://remote-server:90/Communication/CommunicationService.svc" binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_ICommunicationService" contract="CommunicationService.ICommunicationService" name="WSDualHttpBinding_ICommunicationService">
</endpoint>
</client>
真的没办法了,有没有cmets?
【问题讨论】:
-
关闭防火墙以验证它是否阻止来电?
-
你是指IIS服务器中的防火墙吗?我从来没有关闭它,但我的 Vista 机器运行良好,同样对于 WinXP,这个问题在添加 clientBaseAddress 后得到修复,但对于 Win 7 没有运气。但我会尝试你的方式看看它是否相关。谢谢。
-
没有。默认情况下,每台 Windows 机器都使用防火墙,包括你的 Win7。您已将客户端配置为侦听意外端口 91 上的回调(顺便说一句,您应该使用大于 1024 的端口),因此如果防火墙正在运行,它很可能不会为此端口打开。
-
我尝试关闭客户端PC和服务器的防火墙,并将端口从91更改为8001,仍然得到相同的结果
-
仅供参考,此问题在 Vista PC 中不会发生
标签: wcf wcf-binding wcf-client wsdualhttpbinding