【发布时间】:2016-06-17 08:46:26
【问题描述】:
我已经阅读了很多关于它的帖子,但我不知道我的 web.config 会发生什么。
这是 de web.config 代码:
<system.serviceModel>
<client>
<endpoint binding="basicHttpBinding" bindingConfiguration="NewBinding0"
contract="Service.IService" />
</client>
<bindings>
<basicHttpBinding>
<binding name="NewBinding0" closeTimeout="00:05:00" openTimeout="00:05:00"
sendTimeout="00:05:00" maxBufferPoolSize="2147483647" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="NewBinding1" maxBufferSize="2147483647" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above 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" />
很抱歉,我不熟悉 web.conf 文件。我读过我必须设置 maxReceivedMessageSize,但我已经完成了,我收到了同样的错误。
我正在使用 Microsoft 服务配置编辑器编辑文件。 我尝试过使用 basicHttpBinding 和不使用 webHttpBinding,但不起作用。
每次调用 WCF 时,都会收到相同的错误。
在 SOAPUI 中尝试,当消息大小小于 65537 时,它可以工作。当消息大小超过 65536 时,它不起作用。
提前谢谢。
卡尔斯
【问题讨论】:
-
您是否在服务器和客户端都设置了相同的值?他们需要匹配。
标签: wcf iis web-config