简体   繁体   English

从WCF服务调用HTML函数

[英]Calling HTML function from WCF service

I have a callback in WCF service, which receives the raw frames from the camera. 我在WCF服务中有一个回调,该回调从相机接收原始帧。 Now I am writing a HTML application that displays these frames. 现在,我正在编写一个显示这些框架的HTML应用程序。

But, as of now, I use a button click event in HTML to get the current frame from WCF service(using ajax). 但是,到目前为止,我使用HTML中的按钮单击事件来从WCF服务获取当前帧(使用Ajax)。 I would like to get the frames continuously with a single button click event. 我想通过单击一个按钮来连续获取帧。 Any ideas on how to do so? 有关如何操作的任何想法?

Thanks in advance. 提前致谢。

No, you would need your JavaScript to repeatedly call your web service. 不,您需要JavaScript才能反复调用Web服务。

You can't just get a WCF service to return some results, then every few seconds later, return some (updated) results. 您不能只是让WCF服务返回一些结果,然后每隔几秒钟就返回一些(更新的)结果。

//  Call a web service, once every 3 seconds.
setInterval(function() { 
    //  Call your WCF service here
}, 3000);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM