远程服务器返回异常:(413)请求实体太大
我知道这个问题已经被问到很多次,但是不幸的是,我无法将答案调整为有效的解决方案。
我有一个在IIS中运行的WCF服务,当我尝试发送超过64KB的请求时,它会引发413个异常。从我所做的所有研究中,应该足以设置MaxreceivedMessagesize。 有问题的服务是验证服务。我试图发送一个对象,该对象已被编码为字节[]。
我正在运行Windows Server 2019标准的VM中运行此问题,但是此问题也存在于其他环境中。
我已经发布了Pastebin链接到stacktrace,web.config和app.config,以不爆炸帖子的大小。
stacktrace https://pastebin.com/zbsf0nfb
web.config snippet
<binding name="BasicHttpBinding_IValidationService" maxBufferPoolSize="2147483647"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="Ntlm" />
</security>
</binding>
app.config https://pastebin.com/hr7ncbtj
我希望有人能找到我犯的我犯的错误: )
I know that this question has been asked a ton of times, but I have unfortunately not been able to adapt the answers into a working solution.
I have a WCF service, running in the IIS, that throws a 413 exception when I try to send requests that exceed 64KB in size. From all the research I have done it should be enough to set the maxReceivedMessageSize.
The problematic service is the Validation service. I am trying to send an object with attachments that have been base64 encoded into a byte[].
I am running this in a VM running Windows Server 2019 Standard, but this problem is also present in other environments.
I have posted pastebin links to the stacktrace, Web.config, and the App.config to not explode size of the post.
Stacktrace
https://pastebin.com/zbSF0nfB
Web.config snippet
<binding name="BasicHttpBinding_IValidationService" maxBufferPoolSize="2147483647"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="Ntlm" />
</security>
</binding>
App.config
https://pastebin.com/Hr7NcBTJ
I hope that someone is able to find a mistake that I have made :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这篇文章中找到了该解决方案(
工厂为服务创建主机,因为它是默认的SharePoint出厂/主机它没有响应不同web.config文件中所做的更改。因此,该解决方案是用自定义工厂替换工厂,这些工厂使用通常在web.config文件中指定的参数创建主机。
The solution was found in this post (How to override WebServiceHostFactory MaxReceivedMessageSize?)
The problem was the factory creating the host for the service, because it was a default SharePoint factory/host it did not respond to the changes made in the different web.config files. The solution was therefore to replace the factories with custom factories that created the hosts with the parameters that would normally be specified in the web.config files.