通过 basicHttpBinding 和 wsDualHttpBinding 托管的 WCF 回调服务

发布于 2024-09-24 08:20:05 字数 309 浏览 1 评论 0原文

我有一个通过 wsDualHttpBinding 托管的回调服务。我希望添加一个客户端来轮询数据而不是接收回调(将是使用 wince 进行演示的移动设备)。我很好奇做到这一点的最佳方法是什么?您无法使用 NetCFSvcUtil 与 wsDualHttpBinding 托管的服务创建客户端代理(我理解),但您无法通过 basicHttpBinding 托管回调服务。我确实需要在 basicaHttpBinding (客户端将轮询数据)和 wsDualHttpBinding (回调将通知数据的客户端)上托管相同的服务。关于在不创建两个单独的服务来托管相同数据的情况下处理此问题的最佳方法有什么想法吗?

I have a callback service that is hosted over wsDualHttpBinding. I'm looking to add a client that will poll for the data rather than receive the callback (will be a mobile device using wince for demo purposes). I was curious what the best way to do this is? You cannot create a client proxy using NetCFSvcUtil with a service hosted with wsDualHttpBinding (I understand that), but you cannot host a callback service over basicHttpBinding. I really need the same service hosted over both basicaHttpBinding (clients will poll for data) and wsDualHttpBinding (callback will notify clients of data). Any ideas on the best way to handle this without creating two separate services to host the same data?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

烟凡古楼 2024-10-01 08:20:05

托管相同数据的两个独立服务是什么意思?您是否希望共享相同的服务实例来处理 wsDualHttpBinding 和 basicHttpBinding 请求?

您当前的问题是双工通信的服务接口不能用于 basicHttpBinding。您必须创建第二个服务合同并在同一服务中实施它。在这种情况下,您可以公开该服务的两个端点:一个使用 WSDualHttpBinding 双工,另一个使用 BasicHttpBinding。端点必须具有不同的相对地址。从客户端的角度来看,这些端点是单独的服务 - 每个端点都需要单独的客户端代理。因此,除非您的服务是单例的,否则您将为每个客户端代理拥有新的服务实例。新的服务实例意味着没有数据共享。

有一些可能性可以修改此行为,但这意味着替换实例提供程序。

What do you mean by two separate services hosting the same data? Do you expect to share same service instance to handle both wsDualHttpBinding and basicHttpBinding requests?

Your current problem is that service interface for duplex communication cannot be used for basicHttpBinding. You have to create second service contract and implement it in the same service. In that case you can expose two endpoints for the service: one duplex with WSDualHttpBinding and one with BasicHttpBinding. Endpoints must have different relative addresses. From the perspective of the client those endpoints are separate services - each of them requires separate client proxy. So unless your service is singleton you will have new service instance for each client proxy. New service instance means no data sharing.

Thera are some possibilities to modify this behavior but it means replacing Instance provider.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文