restful wcf service makes a client callback whenev

2019-09-19 08:54发布

问题:

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.

回答1:

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