0

Secure SOAP web service consumed with HttpWebRequest taking 30-40 seconds for the first request. Subsequent requests are fast (1-2 seconds).

Nothing wrong on the webservice side as it's responding within same time for all the requests. Log shows request takes time to reach to the web service and I am not sure what is causing this delay.

What can be the issue?

Could the web service requiring client certificate to authenticate be causing this delay?

  • Can you please check setting on IIS configure `keepalive = true` - which may improve the performance because when you request first time app pool need to start. – Anant Dabhi Nov 25 '19 at 03:44
  • Are you behind a proxy? Try set `Proxy` property of `HttpWebRequest` to null. – Hermanto Nov 25 '19 at 03:51
  • Yes, I have checked the IIS, app pool is not recycling. – Ganpat Gutte Nov 25 '19 at 03:57
  • Yes, I am behind the proxy and set the proxy server address in the request so I think it should take that as proxy and should not look for any default proxy address – Ganpat Gutte Nov 25 '19 at 04:03
  • Please check this link https://stackoverflow.com/questions/4932541/c-sharp-webclient-acting-slow-the-first-time and https://stackoverflow.com/questions/4415443/system-net-webclient-unreasonably-slow. It's for `WebClient` but maybe can fit to your case. – Hermanto Nov 25 '19 at 04:13

0 Answers0