3

I have a .net webservice (old-school, not WCF) running on a website on IIS7.

I need to disable http keep-alive for the webservice, but not for the rest of the site.

Is it possible to override what IIS is doing here, just for that service?

I cannot change client code, which is calling in with http 1.1.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Nik
  • 2,718
  • 23
  • 34

1 Answers1

3

See this link

<configuration>
   <system.webServer>
      <httpProtocol allowKeepAlive="false" />
   </system.webServer>
</configuration>
Etch
  • 3,044
  • 25
  • 31
  • Can you explain how that will satisfy my requirement to not disable keep-alives for the rest of the site? Thanks. – Nik Nov 07 '11 at 09:18
  • Are you not able to extract the service to its own site? I know you said you cant change the client code, but are you able to modify where it is pointing if you did that? – Etch Nov 07 '11 at 14:50
  • Unfortunately not - clients are pointing at a specific url which can't be changed. – Nik Nov 07 '11 at 17:22
  • I do not think there is a way to do what you want without involving IIS/a full application setting/changing client code to use HttpWebRequest (assuming .NET). The only other thing I wonder if you could get away with is using an HttpModule to intercept that request then you could directly call the service with a HttpWebRequest to use the KeepAlive property. However I have never done this, its just an idea. – Etch Nov 08 '11 at 22:01