簡體   English   中英

(413)請求實體太大-在Azure上上傳Wcf時

[英](413) Request Entity Too Large - When upload Wcf on Azure

我有一個Wcf服務,該服務在本地的Visual Studio中使用時效果很好,但是當我在Azure上部署它時,如果嘗試將其傳遞給byte [],則會返回“(413)Request Entity Too Large”錯誤。

我上傳的web.config文件是這樣的:

<?xml version="1.0"?>
<configuration>
  <system.diagnostics>
    <trace>
      <listeners>
        <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
      name="AzureDiagnostics">
          <filter type="" />
        </add>
      </listeners>
    </trace>
  </system.diagnostics>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
  </system.web>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding maxReceivedMessageSize="2147483647"
    maxBufferSize="2147483647"
    maxBufferPoolSize="2147483647">
          <readerQuotas maxDepth="32"
      maxArrayLength="2147483647"
      maxStringContentLength="2147483647"/>
        </binding>
      </basicHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false before deployment -->
          <serviceMetadata httpGetEnabled="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="false"/>
        </behavior>

      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <!--
    To browse web app root directory during debugging, set the value below to true.
    Set to false before deployment to avoid disclosing web app folder information.
-->
    <directoryBrowse enabled="true"/>
  </system.webServer>
</configuration>

檢查此鏈接對您有幫助:

(413請求實體太大

IIS7-(413)請求實體太大| 應將UploadReadAheadSize

還要簽入也具有相同綁定名稱的客戶端webconfig。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM