Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8236713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:13:21+00:00 2026-06-07T19:13:21+00:00

I provide a Web Service for my clients which allow him to add a

  • 0

I provide a Web Service for my clients which allow him to add a record to the production database.

I had an incident lately, in which my client’s programmer called the service in a loop , iterated to call to my service thousands of times.

My question is what would be the best way to prevent such a thing.

I thought of some ways:
1.At the entrence to the service, I can update counters for each client that call the service, but that looks too clumbsy.
2.Check the IP of the client who called this service, and raise a flag each time he/she calls the service, and then reset the flag every hour.

I’m positive that there are better ways and would appriciate any suggestions.

Thanks, David

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T19:13:22+00:00Added an answer on June 7, 2026 at 7:13 pm

    The way is to store on the session a counter and use the counter to prevent too many calls per time.

    But if your user may try to avoid that and send different cookie each time*, then you need to make a custom table that act like the session but connect the user with the ip, and not with the cookie.

    One more here is that if you block basic on the ip you may block an entire company that come out of a proxy. So the final correct way but more complicate is to have both ip and cookie connected with the user and know if the browser allow cookie or not. If not then you block with the ip. The difficult part here is to know about the cookie. Well on every call you can force him to send a valid cookie that is connected with an existing session. If not then the browser did not have cookies.

    [ * ] The cookies are connected with the session.
    [ * ] By making new table to keep the counters and disconnected from session you can also avoid the session lock.

    In the past I have use a code that used for DosAttack, but none of them are working good when you have many pools and difficult application so I now use a custom table as I describe it. This are the two code that I have test and use

    Dos attacks in your web app

    Block Dos attacks easily on asp.net

    How to find the clicks per seconds saved on a table. Here is the part of my SQL that calculate the Clicks Per Second. One of the tricks is that I continue to add clicks and make the calculation of the average if I have 6 or more seconds from the last one check. This is a code snipped from the calculation as an idea

    set @cDos_TotalCalls = @cDos_TotalCalls + @NewCallsCounter
    
    SET @cMilSecDif = ABS(DATEDIFF(millisecond, @FirstDate, @UtpNow))
    
    -- I left 6sec diferent to make the calculation
    IF @cMilSecDif > 6000
        SET @cClickPerSeconds = (@cDos_TotalCalls * 1000 / @cMilSecDif)
    else
        SET @cClickPerSeconds = 0
    
    IF @cMilSecDif > 30000
        UPDATE ATMP_LiveUserInfo SET cDos_TotalCalls = @NewCallsCounter, cDos_TotalCallsChecksOn = @UtpNow WHERE cLiveUsersID=@cLiveUsersID         
    ELSE IF @cMilSecDif > 16000
        UPDATE ATMP_LiveUserInfo SET cDos_TotalCalls = (cDos_TotalCalls / 2), 
        cDos_TotalCallsChecksOn = DATEADD(millisecond, @cMilSecDif / 2, cDos_TotalCallsChecksOn)
            WHERE cLiveUsersID=@cLiveUsersID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a wcf web service and I need to provide the client with
I wish to use Spring MVC to provide a REST web service. However, running
Is there a web-service/API that will provide information on who the US State and
Powershell provides the New-WebServiceProxy cmdlet which allows for a web service proxy object to
I am creating a web site which in which the service providers can create
I'm trying to self-host a WCF web service and provide a HTTP endpoint with
In my client application I have to use web service UserNameOverTransport, so I need
The numerous technologies for writing SOAP web services allow me to create services which
I'm building web application (in this context the client) which talk with a different
I found a simple web service online at http://chennaiemergency.co.in/sree/s2.php?wsdl which i am able to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.