ASMX Web服务参考如何设置等效于MaxReceivedMessageSize [英] ASMX web service reference how to set equivalent to MaxReceivedMessageSize
问题描述
Web服务是ASMX Web服务(不是WCF)
Web Service is an ASMX web service (NOT WCF)
我收到错误
已超过传入消息的最大消息大小配额(65536).要增加配额,请在适当的绑定元素上使用MaxReceivedMessageSize属性
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
我使用的是Visual Studio为您添加"Web参考"时为您生成的代理(请注意,我没有添加服务参考",而是使用Web参考)...这将创建一个代理继承自SoapHttpClientProtocol
I am using a proxy that Visual Studio generates for you when you add a "Web Reference" (please note that I am NOT adding "Service Reference", instead I am using Web Reference)... this creates a proxy that inherits from SoapHttpClientProtocol
有人可以帮我弄清楚如何为该方法设置等效于MaxReceivedMessageSize
的方法吗? (如果我使用的是WCF,我要求进行HttpBinding.MaxReceivedMessageSize = Int32.MaxValue
的等效操作)
Can anyone help me figure out how to set the equivalent to MaxReceivedMessageSize
for this method? (I am asking for the equivalent of doing HttpBinding.MaxReceivedMessageSize = Int32.MaxValue
if I were using WCF)
推荐答案
也许可以帮助某人.我在ASMX Web服务中收到相同的错误消息,但这不是来自服务器!它来自客户端,我只是将其添加到客户端配置中:
maybe it help someone. I get same error message in ASMX Web service but that's not from server! it was from client and i just add this to client config:
<basicHttpBinding>
<binding name="BindingName" maxBufferPoolSize="20000000" maxReceivedMessageSize="20000000" maxBufferSize="20000000" />
</basicHttpBinding>
这篇关于ASMX Web服务参考如何设置等效于MaxReceivedMessageSize的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!