restful wcf服务使得客户端回调每当服务器中有更新 [英] restful wcf service makes a client callback whenever there is update in a server

查看:155
本文介绍了restful wcf服务使得客户端回调每当服务器中有更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过c ++控制台应用程序编写WCF RESTFUL服务。客户端使用浏览器并通过我的restful wcf服务连接到该c ++应用程序,每当我的wcf服务从c + +应用程序获取更新,我需要发送状态更新到浏览器客户端,而浏览器不刷新页面。我如何做到这一点?请帮助我。非常感谢提前。


解决方案

不幸的是,你不能使用WCF和WebHttpBinding或者,您可以使用支持回调的WCF绑定,或者在ASP.net WEB.API服务中查看运行SignalR。



注意支持回调的WCF绑定双面)是:



NetTcpBinding
NetNamedPipeBinding
WSDualHttpBinding


I am writing a WCF RESTFUL service over a c++ console application. client uses a browser and connects to that c++ application via my restful wcf service,Whenever my wcf service gets an update from c++ application, I need to send that status update to a browser client without the browser refreshing the page. How can I do this? please help me out. Thanks a lot in advance.

解决方案

Unfortunately you can't do this with WCF and the WebHttpBinding (REST) binding. Alternatively you can use a WCF binding that supports callbacks or take a look at running SignalR in an ASP.net WEB.API service.

Note the WCF bindings that support callbacks (duplex) are:

NetTcpBinding NetNamedPipeBinding WSDualHttpBinding

这篇关于restful wcf服务使得客户端回调每当服务器中有更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆