WCF REST + PUSH +与WPF/Silverlight/etc一起使用... [英] WCF REST + PUSH + consume with WPF/Silverlight/etc...

查看:64
本文介绍了WCF REST + PUSH +与WPF/Silverlight/etc一起使用...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找有关如何设计支持推的WCF REST服务以及如何从WPF和其他客户端使用它的示例. WCF服务如何保持引用并保持连接打开等.

 

我真的不知道从哪里开始推,实际上我有一个WCF REST服务,客户端每6秒轮询一次.我听说我会是一种更好的方法,可以为每个客户端保持连接打开状态,并在有新内容的地方推送"数据.

 

预先感谢!

解决方案

您好,REST服务通常不支持服务器推送.有两种解决方法.一种是在客户端上创建服务,然后让服务器端服务在要推送某些数据时调用客户端上托管的服务.这有效 对于WPF之类的桌面客户端,但这对于Silverlight之类的浏览器客户端来说是一个挑战.另一个解决方案是,客户端按照您现在的常规方式轮询服务.


Hi,

i am looking for example of how to design a WCF REST service supporting push and how to consume it from WPF and other clients. How does the WCF service keep a reference and keep the connection open, etc...

 

I really dont know where to start with push, actually i have a WCF REST service with clients polling it every 6sec. i heard i would be a better approach to keep the connection open for every clients and 'push' the data where there is new stuffs available.

 

Thanks in advance!

解决方案

Hello, REST services in general don't support server push. There're two workarounds. One is to create a service on the client side, and let your server side service to onvoke the service hosted on the client when it wants to push some data. This works for desktop clients like WPF, but it's a challenge for browser clients like Silverlight. The other solution is the client polls the service at a regular intervel, as you're doing now.


这篇关于WCF REST + PUSH +与WPF/Silverlight/etc一起使用...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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