gpt4 book ai didi

WCF MaxReceivedMessageSize 属性未采用

转载 作者:行者123 更新时间:2023-12-02 04:56:48 24 4
gpt4 key购买 nike

搜索没有成功...

我不断得到

The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.

这是有道理的,所以我进入服务器和客户端配置并进行更改:

客户端

<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IFileUpload"
closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transferMode="Streamed" messageEncoding="Text" maxBufferSize="65536" maxReceivedMessageSize="67108864">
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost/services/FileUpload.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IFileUpload"
contract="CFTW.FileUpload.IFileUpload" name="BasicHttpBinding_IFileUpload" />
</client>
</system.serviceModel>

服务器

    <system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IFileUpload"

transferMode="Streamed" messageEncoding="Text" maxBufferSize="67108864" maxBufferPoolSize="67108864" maxReceivedMessageSize="67108864">

</binding>
</basicHttpBinding>

</bindings>
<services>
<service name="BasicHttpBinding_IFileUpload">
<endpoint address="~/services/FileUpload.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IFileUpload"
contract="CFTW.FileUpload.IFileUpload"></endpoint>
</service>

</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>

我不确定为什么它不起作用(否则我会修复它:))。它在 .NET 4.0 RC 上运行。

最佳答案

我刚刚遇到了这个问题。我发现我的自定义绑定(bind)根本没有得到应用。然后我用了name = ""在绑定(bind)标签中。然后一切都开始使用新设置。这是因为 .NET 4.0 带有默认的绑定(bind)/端点/行为配置。这些默认设置有 name = "" 。我刚刚修改了默认绑定(bind)本身。我的自定义绑定(bind)(命名)未应用的原因是 <service> 中的名称值标签。它应该遵循 <Namespace.ServiceClassName> .

关于WCF MaxReceivedMessageSize 属性未采用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2569715/

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