(413) 请求实体太大 - 在 Azure 上上传 Wcf 时
Posted
技术标签:
【中文标题】(413) 请求实体太大 - 在 Azure 上上传 Wcf 时【英文标题】:(413) Request Entity Too Large - When upload Wcf on Azure 【发布时间】:2016-01-20 06:15:13 【问题描述】:我有一个 Wcf 服务,当在本地使用时,Visual Studio 工作得很好,但是当我在 Azure 上部署它时,当我尝试向它传递一个字节 [] 时,它返回一个“(413)请求实体太大”错误。
我上传的 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>
【问题讨论】:
【参考方案1】:检查这个链接它会帮助你:
(413) Request Entity Too Large
IIS7 - (413) Request Entity Too Large | uploadReadAheadSize
同时检查客户端 webconfig 是否具有相同的绑定名称。
【讨论】:
以上是关于(413) 请求实体太大 - 在 Azure 上上传 Wcf 时的主要内容,如果未能解决你的问题,请参考以下文章