我試圖通過MVC和WCF上傳文件。請求太大時無法訪問端點(30 Mb +)
我的MVC項目web.config配置爲recive大文件。
<binding name="BasicHttpBinding_IFile" closeTimeout="00:30:00"
openTimeout="00:30:00" sendTimeout="00:30:00" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" messageEncoding="Mtom" />
當我打電話給我的WCF時,就會出現這個問題。端點是正確的MVC項目和WCF web.config中有此綁定:
<basicHttpBinding>
<binding name="FileUploadServiceBinding"
transferMode="Streamed"
messageEncoding="Mtom"
maxBufferPoolSize="2147483647"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647"
receiveTimeout="00:30:00"
openTimeout="00:30:00"
closeTimeout="00:30:00"
sendTimeout="00:30:00">
<security mode="None">
<transport clientCredentialType="None" />
</security>
<readerQuotas maxDepth="100"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
</binding>
</basicHttpBinding>
我送25MB的文件,它的工作,但是當我嘗試上載30MB以上,我的項目文件無法到達服務,拋出此錯誤消息:
「沒有監聽端點http://localhost:55010/FileService.svc能夠接受該消息。」這通常是由不正確的SOAP地址或操作引起的。獲取更多細節。 「
謝謝!
你還設置了服務器的[MaxBufferSize](https://msdn.microsoft.com/en-us/library/system.servicemodel.basichttpbinding.maxbuffersize(v = vs.95).aspx)嗎?默認值只有64k。任何可能發生超時的機會?任何有可能無法處理消息大小的網絡節點(例如入站代理服務器或網關)? –
服務器的MaxBufferSize也是它的權利。超時時間爲30分鐘。我找到了解決方案。這是服務器的httpRunTime。現在MaxRequestLength屬性是「2147483647」並且它的工作。謝謝你的幫助。 –