简体   繁体   English

(413)请求实体太大-在Azure上上传Wcf时

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

I have a Wcf service that when is used in local whith visual studio works perfectly but when i deploy it on Azure it returns a "(413) Request Entity Too Large" error whe i try to pass it a byte[]. 我有一个Wcf服务,该服务在本地的Visual Studio中使用时效果很好,但是当我在Azure上部署它时,如果尝试将其传递给byte [],则会返回“(413)Request Entity Too Large”错误。

The web.config file that i've upload is like this: 我上传的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>

Check this links it il help u: 检查此链接对您有帮助:

(413) Request Entity Too Large (413请求实体太大

IIS7 - (413) Request Entity Too Large | IIS7-(413)请求实体太大| uploadReadAheadSize 应将UploadReadAheadSize

also check in client webconfig also having same binding name or not. 还要签入也具有相同绑定名称的客户端webconfig。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM