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.
And in the app.config I have this:
Does anyone know how to get past this?
Thanks in advance!
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;
Code:
<system.net> <defaultProxy > <proxy autoDetect="True"/> </defaultProxy> </system.net>
Thanks in advance!
Comment