consecutive HttpWebRequest to a Web Service server failing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MedIt
    New Member
    • Feb 2008
    • 15

    consecutive HttpWebRequest to a Web Service server failing

    Hi All,
    I am trying to Post a number of requests to a web service on a client server from a console application.Thr ough this application I am firing some 400 requests to the Web Service, one after another.
    Now the problem, the first few requests gets to the web service, and fails all the consecutive requests after that, returning 404 page not found from IIS, not from the Web Service.
    We had some problem with the proxy setting from our side, so we had to do some patch on our code to send the request.
    Here's the code snipet:
    With (string username, string password, string url, string method, string contentType, string testName) passed as parameters.
    Code:
    			Uri uri = new Uri(url);
    			HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
    			// Automatically follow redirection responses from the Internet resource set to false
    			request.AllowAutoRedirect = true;
    			NetworkCredential nc = new NetworkCredential(username, password, url);
    			NetworkCredential netCred = new NetworkCredential(username, password);
    			request.Credentials = netCred;
    			// Setting the value of KeepAlive property to false to make persistant connection to Web Service
    			request.KeepAlive = true;
    			request.Method = method;
    			request.ProtocolVersion = HttpVersion.Version11;
    			request.AllowWriteStreamBuffering = true;
    			request.ContentType = contentType;
    And in the app.config I have this:
    Code:
    	<system.net>
    		<defaultProxy >
    			<proxy autoDetect="True"/>
    		</defaultProxy>
    	</system.net>
    Does anyone know how to get past this?
    Thanks in advance!
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Is you webservice running on a server instance of windows? IIS limits to like 10 connections (2 consecutive) if you're NOT on a server OS I believe

    Comment

    • MedIt
      New Member
      • Feb 2008
      • 15

      #3
      Thanks for your response!
      It turns out that one of our load balancer was badly configured... and it solved when LB was configured correctly.

      Comment

      Working...