views:

39

answers:

3

hello, I have a WCF service that has been giving me this error under load conditions (and I cant seem to recreate the error otherwise). we've been trying to find a way aroud it for about a week now with no such luck..

actually, the error I see has two parts to it,

System.ServiceModel.CommunicationException: An error: (The request was aborted: the request was cancelled.) occurred while transmitting data over the http channel.

and:

System.Net.WebException: The request was aborted: the request was cancelled.

I've seen many people suggest to disable working with keep alive by overloading a method in the reference.cs file and setting keepAlive= false, however out client side is using a service reference (in addition to web reference) and this option does not exist anymore.

Another option Ive seen was to add a custom Binding to the service instead of the BasicHTTPBinding we are using now, but that would bother backwards support of the webservice to those who have been using a webReference (since CustomBinding is not soap enabled).

Has anyone dealt with this error before? is there a way to disable keep alive in WCF without affecting the server side? is there anything other that keep alive that is known to cause this error?

thank you very much i advance..

A: 

I don't think that HTTP keep alive is responsible for this. WCF should be able to handle this by itself so the HTTP persistant connection is shared among requests and if it expires (it expires after 100s of inactivity) WCF creates new one without firing any exception. If your connection is aborted during request transmission then I expect there will be some other problem.

You can use this custom binding as equivalent to BasicHttpBinding without HTTP keep alive:

<bindings>
  <customBinding>
    <binding name="NoKeepAlive">
      <textMessageEncoding messageVersion="Soap11" />
      <httpTransport keepAliveEnabled="false" />
    </binding>
  </customBinding>
</bindings> 
Ladislav Mrnka
Yes, it is responsible and I have seen it before.
Aliostad
A: 

That is the problem of a protocol-agnostic framework, cannot access the context and Microsoft after so many complaints added such support that they were evading initially.

You can access Http Context and do what you want. Have a look here:

http://blogs.msdn.com/b/justinjsmith/archive/2007/08/22/setting-http-headers-in-wcf-net-3-5.aspx

Aliostad
A: 

hello, Thank you for the answers, we tried to change the keep alive which seemed to work until recently when we saw the error return again. One thing I failed to mention in my last post was that we are using a WSD (load balancer) to balance loads on the server. I dont know if that might ring a bell to anyone but it might have something to do with the problem, but we trued running a load test using just one IIS (the WSD has 3) and the problem didn't happen. Each IIS has a few services on it, and each one is in its own app pool, so one won't affect the other, and the problem is with one specific service. As I said this problem only occures after 400 users (more or less) working with the service..

I hope this sounds familiar or raises an idea, thanx :)

audzzy