How to automate task of consuming webservice

前端 未结 2 675
臣服心动
臣服心动 2021-01-23 04:35

I have a winform application which needs to consume a web service. Web service checks in the database for any changes. If there are any changes

2条回答
  •  深忆病人
    2021-01-23 05:16

    SignalR allows you to implement Web Services to do this very thing, in real time (no need for a timer or delay between updates). It allows you to set up a persistent connection between client and server, the server is then able to send messages to the client at any point using a stack of transports; WebSockets, Server Sent Events, Forever Frame and Long Polling) based on support available in that order.

    You could use SignalR to establish the connection and when something happens on the Server (such as the change in the database you mentioned) broadcast to all clients that need to be notified. eg.

    Clients.All.notifyDatabaseChanged(args);
    

提交回复
热议问题