使用 Windows Communication Foundation 进行实时更新
我正在尝试使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论