接口 asmx 接收数据过大 发生错误

原文:
https://www.cnblogs.com/xinaixia/p/5945316.html



.NET Framework

错误:已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。


1、客户端程序

在app.config这个文件中,根据name找到对应的binding项,为该项添加属性 maxReceivedMessageSize="2147483647"。

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="ProjectSoap"  maxReceivedMessageSize="2147483647" />
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://192.168.2.73:8094/Websever/Project.asmx"
                binding="basicHttpBinding" bindingConfiguration="ProjectSoap"
                contract="ServiceReference1.ProjectSoap" name="ProjectSoap" />
        </client>
    </system.serviceModel>
</configuration>

2、服务端程序

在Web.config这个文件中,根据name找到对应的binding项,为该项添加属性 maxReceivedMessageSize="2147483647"。



.NET Core

客服端

原文:
https://stackoverflow.com/questions/46906018/asp-net-core-2-0-wcf-configure-binding

服务端

posted @ 2020-08-21 09:13  古兴越  阅读(292)  评论(0)    收藏  举报