简体   繁体   English

WCf与Jquery的双工通信

[英]WCf duplex communication with Jquery

I have a WCF service and I need to setup the service to broadcast notifications to all the connected clients. 我有WCF服务,我需要设置服务以向所有连接的客户端广播通知。 However the call to WCF is made from jquery. 但是,对WCF的调用是通过jquery进行的。 So I need a method to be able to call back the jquery methods from WCF for broadcast. 因此,我需要一种能够从WCF回调jquery方法进行广播的方法。 So basically I need a way to be able to call the jquery methods from WCF. 因此,基本上我需要一种能够从WCF调用jquery方法的方法。

Please let me know if its possible and also any sample to illustrate it. 请让我知道它是否可能,以及任何示例来说明它。

Calling WCF directly from JQuery for your scenario is not a good solution. 对于您的方案,直接从JQuery调用WCF并不是一个好的解决方案。

You cannot use WCF duplex outside intranet environments because of issues such as firewalls. 由于防火墙等问题,您无法在Intranet环境之外使用WCF双工。

You have browser clients and you need to broadcast. 您有浏览器客户端,需要广播。 Try using any implementations of xmpp such as SignalR . 尝试使用xmpp的任何实现,例如SignalR Implementing SignalR from scratch is much easier than maintaining your current WCF code in this scenario. 从头开始实现SignalR比在这种情况下维护当前的WCF代码容易得多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM