I've got a problem with a response from server. When an operation takes longer than one minute in server side, client can't get the response, but logs say, than respons开发者_如何学Ce is sent from server. Everything is fine, when an operation on the server-side is less than one minute.
Client config:
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="NewBehavior0">
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
<clientCredentials />
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_B2BServices" closeTimeout="00:10:00"
openTimeout="00:01:00" receiveTimeout="00:21:00" sendTimeout="00:21:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Mtom" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:15:00"
enabled="true" />
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address=https://.../MatrixConnector/Services.svc
behaviorConfiguration="NewBehavior0"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_B2BServices"
contract="MatrixServiceReference.B2BServices" name="WSHttpBinding_B2BServices">
<identity>
<dns value="..." />
</identity>
</endpoint>
</client>
</system.serviceModel>
Server side:
<system.serviceModel>
<diagnostics>
<messageLogging logEntireMessage="true" logKnownPii="true" logMalformedMessages="true"
logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true"
maxMessagesToLog="2147483647" maxSizeOfMessageToLog="2147483647" />
<endToEndTracing propagateActivity="true" activityTracing="true"
messageFlowTracing="true" />
</diagnostics>
<bindings>
<wsHttpBinding>
<binding name="WsHttpBinding"
closeTimeout="00:21:00" openTimeout="00:02:00" receiveTimeout="00:30:00" sendTimeout="00:30:00"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Mtom">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession enabled="true" inactivityTimeout="00:20:00" />
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" />
<message clientCredentialType="UserName" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="serviceBehavior" name="mediaSens.Services.B2BServices">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="WsHttpBinding"
contract="mediaSens.Services.IB2BServices">
<identity>
<dns value="..." />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress=http://.../ />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="serviceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType="mediaSens.Services.CustomUserNameValidator, mediaSens.Services" />
</serviceCredentials>
<serviceThrottling maxConcurrentCalls="1000" maxConcurrentSessions="2000"
maxConcurrentInstances="1500" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="1" />
</system.serviceModel>
And now i get an errors on server side after 30 minutes:
The communication object, System.ServiceModel.Channels.ReplyChannel, cannot be used for communication because it has been Aborted.
All properties all set above 20 minutes and client can't handle with operations that take longer than one minute. Additionaly I've made:
client.InnerChannel.OperationTimeout = new TimeSpan(0, 30, 0);
...but no results.
I've increased Application Pools settings: Ping Maximum Response Timie: 1140 sec Shutdown Time Limit: 1200 sec Ping period: 30 sec.
I also turned recycilng off. Same behavior.
I tried with relabionSession off but nothing...
EDIT. I've discovered, that client can't get an answer after 90 seconds. This is a default value for exececutionTime in IIS. I've increased this value to 3600 seconds, turned debug off but client still can't retrive any response after that time. I've created net.tcp server and same results, but in localhost there is no such problem. I'm really confused...
<system.web>
<hostingEnvironment idleTimeout="600" shutdownTimeout="700" />
</system.web>
This code solved the problem.
Increase open timeout in the client config file
精彩评论