C# WCF SOAP服务提供MaxReceivedByte错误
我有一个应用程序,最近在使用第三方web服务时抛出了很多错误。具体来说,我得到以下错误:C# WCF SOAP服务提供MaxReceivedByte错误,c#,web-services,wcf,soap,C#,Web Services,Wcf,Soap,我有一个应用程序,最近在使用第三方web服务时抛出了很多错误。具体来说,我得到以下错误: 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. 我已经在我的web.config中检查了绑定,它们
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.
我已经在我的web.config中检查了绑定,它们实际上相当大。当然大于65536(16位无符号短)
这在过去使用此配置时一直运行良好,我们没有对涉及此代码或此配置的代码进行任何更改。我认为这可能是服务器反馈的错误,也许他们从我的代码中接收了太多数据,而不是相反?但我不想求助于他们,直到我做了我的尽职调查,并确保它不是在我这边
该应用程序是在Windows 2012上运行的ASP.NET应用程序。IIS7
这是我的配置中的System.ServiceModel。在所有披露中,我的配置有一个巨大的System.ServiceModel,它实际上位于多个文件中。以下是与此服务呼叫相关的要素
<system.serviceModel>
<client>
<endpoint address="https://webxml.choicepoint.com/multistate"
binding="basicHttpBinding"
bindingConfiguration="InteractiveOrderHandlerBinding"
contract="ChoicePointWS.InteractiveOrderHandler"
name="InteractiveOrderHandlerPort" />
</clent>
<bindings>
<basicHttpBinding>
<binding name="InteractiveOrderHandlerBinding" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="327680" maxBufferPoolSize="524288" maxReceivedMessageSize="327680"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="81920000" maxArrayLength="16384"
maxBytesPerRead="40960000" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
<binding name="basicHttpBinding" maxReceivedMessageSize="102400000"
maxBufferSize="102400000" sendTimeout="00:30:00" receiveTimeout="infinite">
<readerQuotas maxArrayLength="16384000" maxBytesPerRead="40960000"
maxDepth="32" maxNameTableCharCount="16384000"
maxStringContentLength="81920000" />
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="wsHttpBinding" maxReceivedMessageSize="102400000"
sendTimeout="00:30:00" receiveTimeout="infinite">
<readerQuotas maxArrayLength="16384000" maxBytesPerRead="40960000"
maxDepth="32" maxNameTableCharCount="16384000"
maxStringContentLength="81920000" />
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
TIA.是否“最大接收字节错误”正确?似乎错误更像是超出了最大消息大小(65536)“”
我怀疑这是你的配置。不是第三方。与您发布的(详细)错误一致,我看到后面的错误是由于maxReceivedMessageSize值对于返回的消息来说太小而导致的。这个错误看起来可能是零星的,但根据我的经验,它实际上可能只是因为有时会收到出乎意料的大响应。考虑最大值<强> 2147283954 < /强>(我想)。
我建议您非常小心地跟踪您的设置,并确保您已更新了正确的端点,BasichtpBinding,maxReceivedMessageSize
部分的其余部分吗?@Tim,据我所知,我添加了相关部分。正如我在编辑中提到的,这一部分实际上相当大,分为5个不同的文件,因为我的应用程序对内部系统和外部系统进行的服务调用太多。
<system.serviceModel>
<client>
<endpoint address="https://webxml.choicepoint.com/multistate"
binding="basicHttpBinding"
bindingConfiguration="InteractiveOrderHandlerBinding"
contract="ChoicePointWS.InteractiveOrderHandler"
name="InteractiveOrderHandlerPort" />
</clent>
<bindings>
<basicHttpBinding>
<binding name="InteractiveOrderHandlerBinding" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="327680" maxBufferPoolSize="524288" maxReceivedMessageSize="327680"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="81920000" maxArrayLength="16384"
maxBytesPerRead="40960000" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
<binding name="basicHttpBinding" maxReceivedMessageSize="102400000"
maxBufferSize="102400000" sendTimeout="00:30:00" receiveTimeout="infinite">
<readerQuotas maxArrayLength="16384000" maxBytesPerRead="40960000"
maxDepth="32" maxNameTableCharCount="16384000"
maxStringContentLength="81920000" />
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="wsHttpBinding" maxReceivedMessageSize="102400000"
sendTimeout="00:30:00" receiveTimeout="infinite">
<readerQuotas maxArrayLength="16384000" maxBytesPerRead="40960000"
maxDepth="32" maxNameTableCharCount="16384000"
maxStringContentLength="81920000" />
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>