A WCF client returns the above exception after 120 seconds when calling a method which returns a string "success". Logs from the server show it executes fully and completes in around 3 minutes. With tracing enabled I see no errors thrown. Any help would be greatly appreciated as other suggestions from similar problems unfortunately haven't helped. Thanks!
EDIT - Solved: Turns out that the client was using a Smoothwall filtering device which was closing connections after two minutes.
Exception:
System.ServiceModel.CommunicationException The underlying connection was closed: The connection was closed unexpectedly.
Stack Trace: at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
InnerException:
System.Net.WebException The underlying connection was closed: The connection was closed unexpectedly.The underlying connection was closed: The connection was closed unexpectedly.
Stack Trace: at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
As far as I can see, the bindings are set up correctly and the timeouts are beyond 120 seconds. Here's the client binding:
<bindings>
<customBinding>
<binding name="CustomBinding_IPHG" closeTimeout="00:05:00"
openTimeout="00:05:00" receiveTimeout="00:15:00" sendTimeout="00:15:00">
<security authenticationMode="SecureConversation" requireDerivedKeys="false">
<localClientSettings maxClockSkew="00:30:00" />
<localServiceSettings maxClockSkew="00:30:00" />
<secureConversationBootstrap authenticationMode="UserNameOverTransport">
<localClientSettings maxClockSkew="00:30:00" />
<localServiceSettings maxClockSkew="00:30:00" />
</secureConversationBootstrap>
</security>
<textMessageEncoding>
<readerQuotas maxStringContentLength="5242880" />
</textMessageEncoding>
<httpsTransport maxReceivedMessageSize="6553600" useDefaultWebProxy="true" />
</binding>
</customBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="commonBehaviour">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
<clientCredentials>
<serviceCertificate>
<authentication certificateValidationMode="PeerOrChainTrust"/>
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
Here's the server binding:
<bindings>
<customBinding>
<binding name="CommonBinding" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:15:00" sendTimeout="00:15:00">
<transactionFlow />
<security authenticationMode="SecureConversation" requireDerivedKeys="false">
<secureConversationBootstrap authenticationMode="UserNameOverTransport">
<localServiceSettings maxClockSkew="00:30:00" />
<localClientSettings maxClockSkew="00:30:00" />
</secureConversationBootstrap>
<localServiceSettings maxClockSkew="00:30:00" />
<localClientSettings maxClockSkew="00:30:00" />
</security>
<textMessageEncoding>
<readerQuotas maxStringContentLength="41943040"/>
</textMessageEncoding>
<httpsTransport maxBufferSize="41943040" maxReceivedMessageSize="41943040" />
</binding>
</customBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="BehaviorRBS">
<serviceMetadata httpsGetEnabled="true" httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" httpHelpPageEnabled="false" />
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="PHGAPI.PHGUserNamePassValidator, PHGAPI"/>
<serviceCertificate
findValue="*.domainname.com"
x509FindType="FindBySubjectName"
storeLocation="LocalMachine"
storeName="My" />
</serviceCredentials>
<serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="400" maxConcurrentInstances="600" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="BehaviorRBS" name="PHGAPI.iAPI">
<endpoint address="" binding="customBinding" bindingConfiguration="CommonBinding" contract="PHGAPI.IiAPI" />
</service>
</services>
This is the interface for the method in question:
[OperationContract]
string SetSuspensions(List<Suspension> suspensions);