有关 WCF 服务和 Windows 应用程序客户端的帮助
我已经在互联网上浏览了一段时间,但找不到任何适合我的确切问题的东西。如果有人能简洁地解释这一点,我将不胜感激。
基本上我想从我的客户端(Windows 应用程序)调用 WCF Web 服务,该服务将执行更新。不过,我希望该服务能够“回调”客户端的进度,以便用户可以通过可视进度条看到正在发生的情况。这可以做到吗?
我已经研究过全双工 WCF 服务的想法,其中有回调,并尝试编写一些代码,但实际上并没有最大的运气让这些回调触发,我大致了解 wsDualHttpBinding 和 netTcpBinding 之间的磨难,但可以都没有真正开始工作。
目前,我的测试正在同一个盒子上运行,即 Windows 应用程序和 WCF 服务(运行 http://localhost:58781/ )。我知道一旦这些转移到生产环境,我可能会遇到更多问题,所以我希望现在考虑这些问题。
任何对此的帮助将不胜感激。
I have been looking around the internets for some time but can't find anything that fits my exact problem. If someone could explain this succinctly I would be grateful.
Basically I would like to call a WCF web service from my client (Windows App), this service will perform updates. However I would like the service to "callback" to the client with progress so the user can see what's going on via a visual progress bar. Can this be done?
I have looked at the idea of Full Duplex WCF services which have callbacks in them and have tried to write some code, but not having the greatest of luck actually getting these callbacks to fire, I roughly know about the tribulations between wsDualHttpBinding and netTcpBinding but can't really get either to work.
Currently my testing is running off the same box, i.e both the windows application and the WCF service (running off http://localhost:58781/). I know once these move to a production environment I may get more issues so I wish to take these into consideration now.
Any help with this would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个具有自托管服务和客户端的准系统示例。
合同
服务器
客户端
这使用 net.tcp 上的双工通道,并由服务器触发通信来通知客户端进度更新。
客户端会显示:
This is a barebone example with a self hosted service and client.
Contracts
Server
Client
This uses a duplex channel over net.tcp with communications being triggered by the server to inform the client of progress updates.
The client will display: