Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/302.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WCF SOAP服务提供MaxReceivedByte错误_C#_Web Services_Wcf_Soap - Fatal编程技术网

C# WCF SOAP服务提供MaxReceivedByte错误

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中检查了绑定,它们

我有一个应用程序,最近在使用第三方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中检查了绑定,它们实际上相当大。当然大于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 < /强>(我想)。

我建议您非常小心地跟踪您的设置,并确保您已更新了正确的端点,BasichtpBindingmaxReceivedMessageSize


“对于传入消息”-如果这是来自第三方web服务的响应,则这是他们的问题。您可以随意设置您端的配额,但它们对服务上设置的配额没有任何影响。@Tim,对,这就是我要确定的。如果是从我的客户端返回的错误,因此我的配置有问题(或者由于某种原因被应用程序忽略)或者这是一个由服务器抛出的异常,并向进行调用的客户机报告,这反过来会引发它自己的异常。我的直觉是,它是第三方供应商。启用WCF跟踪(如果您还没有)可能会有进一步的帮助。应用程序正在运行.NET的哪个版本?是否将定义的绑定(“InteractiveOrderHandlerBinding”)分配给正在使用的客户端端点?你能发布你配置的
部分的其余部分吗?@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>