1

I have strange problem with WCF service. I use pollingDuplexBinding and Silverlight client. Binding was registred by this code in web.config

<bindingElementExtensions>
   <add name="pollingDuplex" type="System.ServiceModel.Configuration.PollingDuplexElement, System.ServiceModel.PollingDuplex" />
</bindingElementExtensions>

On first call everything is ok - service returns data fast. But second call executes more than 5 mitutes. If I set big timeouts, result will be returned to client, else it throws TimeoutException. WCF method I'm calling does nothing - just returns short string.

WCF tracing says, that second service call just coming 5 minutes later than client calls this method, and executes quickly. I use these service attributes:

[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.Single)]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]

It's client code

        var binding = new PollingDuplexHttpBinding(PollingDuplexMode.SingleMessagePerPoll);            

        var address = new EndpointAddress("/SportService.svc");
        _proxy = new SportDuplexClient(binding, address);
Mikhail
  • 11
  • 1
  • I got answer [here](http://stackoverflow.com/questions/4184469/silverlight-pollingduplex-innerchannel-faulted-with-multiplemessagesperpoll-ser) – Mikhail Nov 20 '12 at 17:45
  • Do you really need AspNetCompatibility? if no - turn off it in web.config, also you can adjust sendTimeout for pollingDuplex bindign as well – sll Nov 22 '12 at 17:05

1 Answers1

0

i hade same problem, i solve it in this way :

just set aspNetCompatibilityEnabled="false" to false in web.config file

<system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true" />
</system.serviceModel>

or set sessionState mode="Off" in web.config

<system.web>
    <sessionState mode="Off" />
</system.web>

in both way my problem will solved...

Emran Sadeghi
  • 612
  • 6
  • 20