WCF:“无法打开 System.ServiceModel.Channels.ClientReliableDuplexSessionChannel”
我目前有一个带有回调合约(双工)的 WCF 服务,当我在我的计算机上使用使用它的应用程序时,一切正常,但当我从另一台计算机上尝试它时,它无法连接。
一旦我切换到使用此 wsDualHttpBinding
(用于回调),这些问题就开始出现,因为当我使用 wsHttpBinding
时,一切工作正常。
为什么 Web 服务不接受其他计算机的请求? 是否需要修改一些托管设置?
至于日志,我得到这些:
alt text http://img17.imageshack。我们/img17/4628/wcfissue.jpg
打开操作未完成 在指定的超时时间内 00:01:00。 分配给这个的时间 操作可能是某个操作的一部分 更长的超时时间
无法打开 System.ServiceModel.Channels.ClientReliableDuplexSessionChannel
有故障 System.ServiceModel.Channels.ClientReliableDuplexSessionChannel
有故障 System.ServiceModel.Channels.ServiceChannel
打开失败 System.ServiceModel.Channels.ServiceChannel
我的路由器上的端口已打开(TCP 和 UDP),因此这不是问题。
关于服务属性,这就是我正在使用的:
接口:
[ServiceContract(Name = "MusicRepo_DBAccess_Service",
CallbackContract = typeof(IOnlineUsersCallback),
SessionMode=SessionMode.Required)]
服务:
[ServiceBehavior(
ConcurrencyMode=ConcurrencyMode.Reentrant,
InstanceContextMode=InstanceContextMode.Single)]
[更新]
至于Orion Edwards'帖子:
- 没有防火墙
- 参见第1点
- 是的我可以,因为我在路由器上转发了端口,所以
- 我使用 IIS 来托管服务器。
问题是,当我从 wsHttpBinding
(工作正常)切换到 wsDualHttpBinding
(因为我需要回调)时,这个问题就开始发生
[更新]
我现在已从 wsDualHttpBinding
切换到 NetTcpBinding
,由于某种原因,一切正常。
我已经使用这篇文章来帮助我在 IIS 上设置托管,谢天谢地,一切都很好按预期工作,带有回调。
I currently have a WCF Service with a CallBack Contract (duplex), and when I use the application that makes use of it on my computer everything works fine, but when I try it from a different computer, it doesn't connect.
These problems started occurring once I switched to using this wsDualHttpBinding
(for callbacks) because when I used wsHttpBinding
everything worked fine.
Why is the web service not accepting requests from other computers? Is it some hosting settings that need to be modified?
As regards the logs, I am getting these:
alt text http://img17.imageshack.us/img17/4628/wcfissue.jpg
The open operation did not complete
within the allotted timeout of
00:01:00. The time allotted to this
operation may have been a portion of a
longer timeoutFailed to open System.ServiceModel.Channels.ClientReliableDuplexSessionChannel
Faulted
System.ServiceModel.Channels.ClientReliableDuplexSessionChannelFaulted
System.ServiceModel.Channels.ServiceChannelFailed to open
System.ServiceModel.Channels.ServiceChannel
The port is open on my router (both TCP and UDP) so that is not the issue.
As regards the Service Attributes, this is what I'm using:
Interface:
[ServiceContract(Name = "MusicRepo_DBAccess_Service",
CallbackContract = typeof(IOnlineUsersCallback),
SessionMode=SessionMode.Required)]
Service:
[ServiceBehavior(
ConcurrencyMode=ConcurrencyMode.Reentrant,
InstanceContextMode=InstanceContextMode.Single)]
[Update]
As regards Orion Edwards' post:
- No Firewall
- See point 1
- Yes I can, because I have the port forwarded on my router
- I'm using IIS to host the server.
The thing is, this problem started happening when I switched from wsHttpBinding
(which was working fine) to wsDualHttpBinding
(because I needed callbacks)
[Update]
I have now switched from wsDualHttpBinding
to NetTcpBinding
and for some reason, everything is working fine.
I have used this article to help me set up hosting on IIS, and thankully everything is working as expected, with callbacks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我现在已从
wsDualHttpBinding
切换到NetTcpBinding
,出于某种原因,一切正常。我已经使用这篇文章来帮助我在 IIS 上设置托管,谢天谢地,一切都很好按预期工作,带有回调。
I have now switched from
wsDualHttpBinding
toNetTcpBinding
and for some reason, everything is working fine.I have used this article to help me set up hosting on IIS, and thankully everything is working as expected, with callbacks.
如果您发布服务器和客户端配置设置,将会有所帮助。
以下是 MSDN 中 wsDualHttpBinding 工作原理的摘要(强调我的) :
It would help if you posted the server and client configuration settings.
Here's a summary of how the wsDualHttpBinding works from MSDN (emphasise mine):
要检查的事项:
ServiceHost
自托管服务器或将其托管在 IIS 下。Things to check:
ServiceHost
or host it under IIS.