如何在客户端级别实现Web服务限制 [英] How to implement web service throttling at client level

查看:62
本文介绍了如何在客户端级别实现Web服务限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序需要调用WebService方法来上传一些xml。这个WebService的提供者有一个限制,即我的应用程序在一分钟之内不能拨打超过900个电话,否则它将被禁止。



我在什么样的逻辑中实现我的C#程序使用这个web方法来处理超过900次调用没有在一分钟内完成。请注意,我的应用程序中没有使用WCF,而是使用简单的httpwebrequest。在此先感谢。

My application needs to call a WebService method to upload some xml. The provider of this WebService has a restriction that my application cannot make more than 900 calls within a minute else it would be banned.

What kind of logic do I implement in my C# program which uses this webmethod to take care that more than 900 calls are not done in a minute. Please note that I am not using WCF but simple simple httpwebrequest in my application. Thanks in advance.

推荐答案

.Net中没有任何内置功能可以为您完成此任务。您只需要编写代码来自己跟踪它。
There is nothing built-in to .Net that will do this for you. You'll just need to write code to keep track of it yourself.


客户端服务限制声音 oxymoron (如果某些限制是服务限制,它在服务器端:-)),但整个事情闻起来很大的滥用。当然,在客户端调整Web服务调用会更有效,但为什么呢?相反,它是对服务器进行大量冗余调用的标志。 如果你加油,它只会使冗余活动变慢。您可能需要重新考虑整个架构以消除冗余,而不是正式的限制。请查看我过去的答案:

应用程序'仪表板'对于网站帐户 [ ^ ],

如何通过服务器计算机控制我的客户端计算机 [ ^ ]。



是的,我明白我的答案可能无法解决您的问题,但这主要是因为我不了解您的目标。我只是想解释为什么你应该考虑改变你的方法;这就是我现在所能做的一切。



-SA
"Service throttling on the client side" sounds oxymoron (if some throttling is "service throttling", it's on server side :-)), but the whole thing smells huge abuse. Of course, throttling of Web service calls on the client side would be more efficient, but why? Rather, it's a sign of having lots of redundant calls to the server. If you throttle it, it will only make the redundant activity slower. Instead of formal throttling, you may need to rethink your whole architecture to eliminate the redundancy. Please see my past answers:
Application 'dashboard' for website accounts[^],
How Do I Control My Client Computers By Server Computer[^].

Yes, I do understand that my answers may not solve your problem, but this is mostly because I don't know your goals. I'm just trying to explain the reasons why you should think about changing your approach; this is all I can do at this moment.

—SA


这篇关于如何在客户端级别实现Web服务限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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