限制呼叫数到ASMX Web服务 [英] Limiting number of calls to an ASMX Web Service

查看:142
本文介绍了限制呼叫数到ASMX Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在IIS6主办的ASMX Web服务。有限制的呼叫,以用于单个IP一段时间的服务的数目的好方法?我们不希望把一个硬限制(一小时x次),但我们希望能够防止单个用户激增。

We have an asmx web service hosted in IIS6. Is there a good way to limit the number of calls to the service in a period of time for a single IP? We don't want to put a hard limit (X number of times an hour), but we want to be able to prevent a spike from a single user.

我们再目前正在调查,看看我们的防火墙能够限制连接尝试。在我们的防火墙是不能够限制连接的情况下,有没有以编程方式处理这个问题的好办法?而不是试图拿出自己的自定义解决方案,并重新发明轮子,有没有可以使用现有的实施或战略?

We're currently investigating to see if our firewall is capable of limiting connection attempts. In the case that our firewall is not able to limit connections, is there a good way to handle this programmatically? Rather than trying to come up with our own custom solution and reinventing the wheel, is there an existing implementation or strategy that can be used?

推荐答案

ASMX Web服务几乎没有可扩展性。如果您有任何的选择,你应该使用WCF。

ASMX web services have almost no extensibility. If you have any choice, you should use WCF.

您也许可以写一个方法,从每个操作的调用,将看主叫IP检查在数据库中,并抛出的SOAPFault如果IP已连接太多。这是对所有有,但。你也许可以做到这一点从的​​SoapExtension,但你必须要非常小心那些。

You might be able to write a method to be called from each of your operations, that would look at the caller IP, check in a database, and throw a SoapFault if that IP has connected too much. That's about all there is, though. You might be able to do that from a SoapExtension, but you have to be very careful with those.

这篇关于限制呼叫数到ASMX Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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