WCF:“无法打开 System.ServiceModel.Channels.ClientReliableDuplexSessionChannel”

发布于 2024-07-19 00:56:47 字数 2064 浏览 4 评论 0原文

我目前有一个带有回调合约(双工)的 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 timeout

Failed to open System.ServiceModel.Channels.ClientReliableDuplexSessionChannel

Faulted
System.ServiceModel.Channels.ClientReliableDuplexSessionChannel

Faulted
System.ServiceModel.Channels.ServiceChannel

Failed 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

残月升风 2024-07-26 00:56:47

我现在已从 wsDualHttpBinding 切换到 NetTcpBinding,出于某种原因,一切正常。

我已经使用这篇文章来帮助我在 IIS 上设置托管,谢天谢地,一切都很好按预期工作,带有回调。

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.

我不吻晚风 2024-07-26 00:56:47

如果您发布服务器和客户端配置设置,将会有所帮助。

以下是 MSDN 中 wsDualHttpBinding 工作原理的摘要(强调我的) :

WSDualHttpBinding 提供了
对 Web 服务协议的相同支持
作为 WSHttpBinding,但用于
复式合同。 WSDualHttpBinding
仅支持 SOAP 安全性
需要可靠的消息传递。 这个
绑定要求客户端有一个
提供回调的公共 URI
服务的端点。 这是
由 clientBaseAddress 提供
属性。
双重绑定公开了
客户端的IP地址
服务。 客户端应该使用
安全性,以确保它只
连接到它信任的服务。

此绑定可用于
通过一个或多个可靠地通信
更多 SOAP 中介。

默认情况下,此绑定生成一个
运行时堆栈
WS-ReliableMessaging 确保可靠性,
WS-Security 用于消息安全和
身份验证,HTTP 消息
交付和文本/XML 消息
编码。

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):

The WSDualHttpBinding provides the
same support for Web Service protocols
as the WSHttpBinding, but for use with
duplex contracts. WSDualHttpBinding
only supports SOAP security and
requires reliable messaging. This
binding requires that the client has a
public URI that provides a callback
endpoint for the service. This is
provided by the clientBaseAddress
attribute.
A dual binding exposes the
IP address of the client to the
service. The client should use
security to ensure that it only
connects to services it trusts.

This binding can be used to
communicate reliably through one or
more SOAP intermediaries.

By default, this binding generates a
runtime stack with
WS-ReliableMessaging for reliability,
WS-Security for message security and
authentication, HTTP for message
delivery, and a Text/XML message
encoding.

各空 2024-07-26 00:56:47

要检查的事项:

  • Windows 防火墙
  • 您的防病毒产品的防火墙
  • 您可以从远程计算机远程登录到该端口吗?
  • 您的“服务器”是否运行在 ASP.NET 开发服务器下? 这只会接受来自本地主机的请求 - 您需要使用 ServiceHost 自托管服务器或将其托管在 IIS 下。

Things to check:

  • Windows Firewall
  • Your antivirus product's firewall
  • Can you telnet into the port from a remote machine?
  • Is your "server" running under the ASP.NET development server? That will only accept requests from localhosts - you need to self-host the server using ServiceHost or host it under IIS.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文