使用 Windows Communication Foundation 进行实时更新

发布于 2024-12-14 21:12:55 字数 1170 浏览 5 评论 0原文

我正在尝试使用 Windows Communication Foundation 和 REST 来实现实时更新;我已经成功解决了一部分(请参阅链接)

所以我订阅了我想要的事件,但没有收到任何通知。这是我在服务器中监听更新的内容:

[OperationContract]
        [WebInvoke(
            Method = "POST", 
            RequestFormat= WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "RTUHandler")]
        void RTUPostInfo(Stream stream);

我有来自 Facebook 的订阅:

{"data":[{"object":"user","callback_url":"http:\/\/mysite.com\/rtu\/rtuhandler.svc\/rtuhandler","fields":["books","friends","interests","movies","music"],"active":true}]}

如您所见,回调的 url 是:

http://mysite.com/rtu/rtuhandler.svc/rtuhandler

要将实时更新与 Windows Communication Foundation 和 REST 结合使用,需要注意什么吗? 附带说明一下,我可以使用 Fiddler 向该 URL 发送 POST 请求,并像 Facebook 那样模拟 Json 数据;并按预期工作...但从 Facebook 我什么也没得到。

提前致谢。

马克西.

I'm trying to implement Real Time Updates by using Windows Communication Foundation and REST; I've successfully solved one part (see link)

So I subscribe to the events that I want, but don't get ANY notification. This is what I have in my server, listening for updates:

[OperationContract]
        [WebInvoke(
            Method = "POST", 
            RequestFormat= WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "RTUHandler")]
        void RTUPostInfo(Stream stream);

I have the subscription working from Facebook:

{"data":[{"object":"user","callback_url":"http:\/\/mysite.com\/rtu\/rtuhandler.svc\/rtuhandler","fields":["books","friends","interests","movies","music"],"active":true}]}

As you can see, the url for callback is:

http://mysite.com/rtu/rtuhandler.svc/rtuhandler

Is there anything that I have to take in account to use Real Time Updates with Windows Communication Foundation and REST?
As a side note, I can send POST requests to that URL using Fiddler and simulating the Json data as Facebook would do; and works as expected...but from Facebook I get nothing.

Thanks in advance.

Maxi.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文