Service timeout error in wsDualHttpBinding binding

Posted on 2011-05-09
Last Modified: 2013-11-12

I have a service with callbacks implemented in WCF through wsDualHttpBinding

I am consuming the service in WPF XBAP solution. I am getting timeout error after some time.

I have tried every possible solution available on net right from changing various binding timeouts to different throttling configurations........All in vain.

The exception is as follows :

The message could not be transferred within the allotted timeout of 00:01:00. There was no space available in the reliable channel's transfer window. The time allotted to this operation may have been a portion of a longer timeout.Source: mscorlib
Stack Trace:
Server stack trace:
   at System.ServiceModel.Channels.TransmissionStrategy.WaitQueueAdder.Wait(TimeSpan timeout)
   at System.ServiceModel.Channels.TransmissionStrategy.InternalAdd(Message message, Boolean isLast, TimeSpan timeout, Object state, MessageAttemptInfo& attemptInfo)
   at System.ServiceModel.Channels.ReliableOutputConnection.InternalAddMessage(Message message, TimeSpan timeout, Object state, Boolean isLast)
   at System.ServiceModel.Channels.ReliableDuplexSessionChannel.OnSend(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.DuplexChannel.Send(Message message, TimeSpan timeout)
   at System.ServiceModel.Dispatcher.DuplexChannelBinder.Send(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at WSDualHttpBindingTest.IWebMxAccessServerServiceCallback.ReceiveMxData(TagUpdatedEventArgs tagDetails)
   at WSDualHttpBindingTest.CalculatorService.wmxServer_OnDataChange(TagUpdatedEventArgs tagDetails) in D:\Others\POCs\WSDualHttpBindingTest\WSDualHttpBindingTest\Service1.svc.cs:line 166
   at WebMxAccessServer.lmxProxy_OnDataChange(Int32 hLMXServerHandle, Int32 phItemHandle, Object pvItemValue, Int32 pwItemQuality, Object pftItemTimeStamp, MXSTATUS_PROXY[]& ItemStatus) in WSDualHttpBindingTest\WebMxServer\WebMxAccessServer.cs:line 232

Any help would be appreciated. Thanx in advance.
Question by:SanjaySutar

    Author Comment

    Service Web.Config

       <service behaviorConfiguration="CalculatorServiceBehavior" name="WSDualHttpBindingTest.CalculatorService">
        <endpoint address="" binding="wsDualHttpBinding" contract="WSDualHttpBindingTest.IWebMxAccessServerService" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    		<!--For debugging purposes set the includeExceptionDetailInFaults attribute to true-->
    				<behavior name="CalculatorServiceBehavior">
    					<serviceMetadata httpGetEnabled="True"/>
              <serviceTimeouts transactionTimeout="00:20:00"/>
    					<serviceDebug includeExceptionDetailInFaults="True"/>
              <serviceThrottling maxConcurrentCalls="5" maxConcurrentInstances="500" maxConcurrentSessions="500"/>

    Open in new window

    Client app.config

            <binding name="WSDualHttpBinding_IWebMxAccessServerService" closeTimeout="00:30:00"
                openTimeout="00:30:00" receiveTimeout="00:30:00" sendTimeout="00:30:00"
                bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
                messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" clientBaseAddress="http://localhost:808/Service1.svc">
              <readerQuotas maxDepth="32" maxStringContentLength="131072000" maxArrayLength="16384"
                  maxBytesPerRead="51200" maxNameTableCharCount="16384" />
              <reliableSession ordered="true" inactivityTimeout="00:10:00" />
              <security mode="Message">
                <message clientCredentialType="Windows" negotiateServiceCredential="true"
                    algorithmSuite="Default" />
          <endpoint address="http://localhost:2660/Service1.svc" binding="wsDualHttpBinding"
              contract="ServiceReference1.IWebMxAccessServerService" name="WSDualHttpBinding_IWebMxAccessServerService">
              <userPrincipalName value="" />

    Open in new window


    Accepted Solution

    Eventually adding  UseSynchronizationContext = false

    to my callback class have fixed the problem.

    Below is the complete class declaration.

    [CallbackBehavior(ConcurrencyMode = ConcurrencyMode.Reentrant, UseSynchronizationContext = false)]

    Author Closing Comment

    I have fixed the issue

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now