我们已经配置为这样一个简单的服务响应:WCF服务超时 - 服务需要几分钟到简单的请求
<configuration>
<connectionStrings>
<add name="CONN" connectionString="Server=MYSERVER,1433;Database=mydb;User Id=user;Password=pass;"/>
</connectionStrings>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
</system.web>
<system.serviceModel>
<services>
<service name="MyNamespace.MyService">
<host>
<baseAddresses>
<add baseAddress="https://mywebsite.com/TestService/"/>
</baseAddresses>
</host>
<endpoint address="" binding="basicHttpBinding" contract="MyNameSpace.IMyService" bindingConfiguration="defaultBinding" bindingNamespace="MyNameSpace"/>
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="defaultBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferPoolSize="2147483647"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
这项服务是在超时之前我添加了额外的参数绑定名称=“defaultBinding “(closeTimeout,openTimeout,receiveTimeout,sendTimeout,maxbuffersize,maxreceivedmessagesize)。
我们的服务器只启用了TLS1.2。 该服务托管在IIS中,证书似乎没问题 - 浏览网页中的WSDL看起来没问题。
在同一台机器的机器上使用SOAPUI作为服务托管超时(我认为这将是非常快?)
是否有web配置设置,我不知道,或者这是否归结为服务器机器或可能的IIS?
请求可能需要几分钟才能完成 - 即使是像GetVersion()调用那样简单的返回字符串也是如此。我们甚至重新启动了机器,IIS等,并尝试了新的请求 - 同样的问题。
像往常一样,所有的WCF时序问题下做一些其他的东西 - 从WCF启用详细的日志,并检查其中时间花在:https://docs.microsoft.com/en-us/dotnet/framework/wcf/diagnostics/configuring-message-logging –
谢谢你的资源@IgorLabutin我会考虑这样做,并会回来任何我找到的。 –
我看着它@IgorLabutin并在下面发布我的答案。花费了时间来处理请求消息,导致连接超时。谢谢。 –