2015-03-03 91 views
0

即使maxReceivedMessageSize設置爲最大值,即2147483647,並且實際消息大小小於50kb,我仍然在WCF服務中遇到413錯誤。WCF中的請求實體太大錯誤(413)

只有在兩次請求之間存在某些理想時間時纔會出現此問題。 確切的情況如下: 1.發送1000條消息,每條消息大約38 kb。狀態:合格 2.等待一段時間(最少3分鐘) 3.發送1條消息。狀態:失敗。 (413錯誤)

我正在使用ws2007FederationHttpBinding。 Web.config文件標籤如下:

<ws2007FederationHttpBinding> 
    <binding name="federationHttpBinding" openTimeout="00:04:00" closeTimeout="00:04:00" receiveTimeout="00:04:00" sendTimeout="00:40:00" maxReceivedMessageSize="2147483647"> 
     <!-- <readerQuotas maxArrayLength="2147483647" maxDepth="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" /> --> 
     <security mode="TransportWithMessageCredential"> 
     <message establishSecurityContext="false"> 
     </message> 
     </security> 
    </binding> 
    </ws2007FederationHttpBinding> 

客戶端綁定標籤如下:

<ws2007FederationHttpBinding> 
    <binding name="AuthorizationBinding" openTimeout="00:04:00" closeTimeout="00:04:00" receiveTimeout="00:04:00" sendTimeout="00:40:00" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647"> 
     <readerQuotas maxArrayLength="2147483647" maxDepth="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647"/> 
     <security mode="TransportWithMessageCredential"> 
     <message establishSecurityContext="false"/> 
     </security> 
    </binding> 
</ws2007FederationHttpBinding> 

回答

0

您還可以設置MAXBUFFERSIZE

<binding name="federationHttpBinding" 
      maxReceivedMessageSize="2147483647" 
      maxBufferSize="2147483647" 
      maxBufferPoolSize="2147483647"> 
+0

它不工作。 maxBufferSize不是有效的屬性,並添加了maxBufferPoolSize,但仍然是相同的問題 – 2015-03-03 09:15:50

+0

您在哪裏託管服務?如果它位於iis中,則可能需要增加一些常規消息大小 – Thorarins 2015-03-03 10:46:19