• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3050
  • Last Modified:

Service timeout error in wsDualHttpBinding binding

Hi,

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.
0
SanjaySutar
Asked:
SanjaySutar
  • 3
1 Solution
 
SanjaySutarAuthor Commented:
Service Web.Config

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

Open in new window



Client app.config

<system.serviceModel>
    <bindings>
      <wsDualHttpBinding>
        <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" />
          </security>
        </binding>
      </wsDualHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost:2660/Service1.svc" binding="wsDualHttpBinding"
          bindingConfiguration="WSDualHttpBinding_IWebMxAccessServerService"
          contract="ServiceReference1.IWebMxAccessServerService" name="WSDualHttpBinding_IWebMxAccessServerService">
        <identity>
          <userPrincipalName value="238801@cts.com" />
        </identity>
      </endpoint>
    </client>
  </system.serviceModel>

Open in new window

0
 
SanjaySutarAuthor Commented:
Eventually adding  UseSynchronizationContext = false

to my callback class have fixed the problem.

Below is the complete class declaration.

[CallbackBehavior(ConcurrencyMode = ConcurrencyMode.Reentrant, UseSynchronizationContext = false)]
0
 
SanjaySutarAuthor Commented:
I have fixed the issue
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now