gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 06:34:04 25 4
gpt4 key购买 nike

我有一个 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>

最佳答案

检查此链接对您有帮助:

(413) Request Entity Too Large

IIS7 - (413) Request Entity Too Large | uploadReadAheadSize

还要检查客户端 webconfig 是否具有相同的绑定(bind)名称。

关于c# - (413) 请求实体太大 - 在 Azure 上上传 Wcf 时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33256099/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com