2014-02-26 99 views
0

我使用basicHttpBinding的我的WCF服务WCF服务的最佳配置

<basicHttpBinding> 
    <binding name="BasicHttpBinding_UtilityService" 
      closeTimeout="01:00:00" openTimeout="01:00:00" 
      receiveTimeout="01:00:00" sendTimeout="01:00:00" 
      allowCookies="false" bypassProxyOnLocal="false" 
      hostNameComparisonMode="StrongWildcard" 
      maxBufferSize="52428800" maxBufferPoolSize="52428800" 
      maxReceivedMessageSize="52428800" 
      messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" 
      useDefaultWebProxy="true"> 
     <readerQuotas 
      maxDepth="52428800" maxStringContentLength="52428800" 
      maxArrayLength="52428800" maxBytesPerRead="52428800" 
      maxNameTableCharCount="52428800"/> 
     <security mode="None"> 
     <transport clientCredentialType="None" proxyCredentialType="None" realm=""/> 
     <message clientCredentialType="UserName" algorithmSuite="Default"/> 
     </security> 
    </binding> 
</basicHttpBinding> 

<behavior name="httpMetadataBehavior"> 
     <serviceMetadata httpGetEnabled="true"/> 
     <serviceDebug includeExceptionDetailInFaults="true"/> 
     <dataContractSerializer maxItemsInObjectGraph="52428800" /> 
     <serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="200" maxConcurrentInstances="200" /> 
</behavior> 

请让知道什么值,我应该把为maxArrayLengthmaxItemsInObjectGraph,开/关和接收超时。如果我将它设置为允许的最大值,那么这样做会有什么伤害吗?

应该如何最优地定义大小和超时值?

回答

0

最适合总是很大程度上取决于您究竟在做什么以及您的要求是什么。

有没有ONE最佳设置 - 你不觉得WCF团队会默认设置,如果它存在?

另外:

设置一切最大允许大小打开门用于拒绝服务的潜在攻击 - 这就是它的设置为2 GB为每个大小值的原因第一名!