Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.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
.net 使用reliableSession与basicHttpBinding的CustomBinding,已超过传入消息(65536)的限制。错误_.net_Wcf - Fatal编程技术网

.net 使用reliableSession与basicHttpBinding的CustomBinding,已超过传入消息(65536)的限制。错误

.net 使用reliableSession与basicHttpBinding的CustomBinding,已超过传入消息(65536)的限制。错误,.net,wcf,.net,Wcf,我在windows server 2008上有一个由IIS 7托管的WCF服务 我需要支持WCF服务的不同配置 当我尝试批量插入4个整数的600行数据表时,我遇到了问题 一种配置是带有reliableSession的自定义绑定 客户端: <customBinding> <binding name="reliableSessionOverHttps" receiveTimeout="00:02:00" sendTimeout="00:02:00" openTimeout=

我在windows server 2008上有一个由IIS 7托管的WCF服务

我需要支持WCF服务的不同配置

当我尝试批量插入4个整数的600行数据表时,我遇到了问题

一种配置是带有reliableSession的自定义绑定

客户端:

<customBinding>
    <binding name="reliableSessionOverHttps" receiveTimeout="00:02:00" sendTimeout="00:02:00" openTimeout="00:02:00" closeTimeout="00:02:00">
      <reliableSession inactivityTimeout="00:10:00" flowControlEnabled="true" maxTransferWindowSize="4096" maxPendingChannels="4" ordered="true" maxRetryCount="4" reliableMessagingVersion="Default" acknowledgementInterval="00:10:00"/>
      <httpsTransport maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" manualAddressing="false" allowCookies="false" authenticationScheme="Anonymous" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" keepAliveEnabled="true" proxyAuthenticationScheme="Anonymous" realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false" useDefaultWebProxy="true"/>
    </binding>
  </customBinding>

我的服务器配置:

<customBinding>
    <binding name="reliableSessionOverHttps" receiveTimeout="00:01:00"
           sendTimeout="00:01:00"
           openTimeout="00:01:00"
           closeTimeout="00:05:00">
      <reliableSession />
      <httpsTransport maxReceivedMessageSize="2147483647"/>
    </binding>
  </customBinding>
<basicHttpBinding>
    <binding name="basicHttpBindNoCert" receiveTimeout="00:02:00" sendTimeout="00:02:00" openTimeout="00:02:00" closeTimeout="00:02:00"  
       maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" maxBufferSize="2147483647"  allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"  transferMode="Buffered" useDefaultWebProxy="true">
    </binding>
  </basicHttpBinding>
<basicHttpBinding>
    <binding name="secureHttpBinding" receiveTimeout="00:01:00"
           sendTimeout="00:01:00"
           openTimeout="00:01:00"
           closeTimeout="00:05:00" maxReceivedMessageSize="2147483647">
    </binding>
  </basicHttpBinding>

一切正常

但是当我使用basicHttpBinding时,我得到:“已超过传入消息的最大消息大小配额(65536)。要增加配额,请在相应的绑定元素上使用MaxReceivedMessageSize属性”

客户端:

<customBinding>
    <binding name="reliableSessionOverHttps" receiveTimeout="00:01:00"
           sendTimeout="00:01:00"
           openTimeout="00:01:00"
           closeTimeout="00:05:00">
      <reliableSession />
      <httpsTransport maxReceivedMessageSize="2147483647"/>
    </binding>
  </customBinding>
<basicHttpBinding>
    <binding name="basicHttpBindNoCert" receiveTimeout="00:02:00" sendTimeout="00:02:00" openTimeout="00:02:00" closeTimeout="00:02:00"  
       maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" maxBufferSize="2147483647"  allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"  transferMode="Buffered" useDefaultWebProxy="true">
    </binding>
  </basicHttpBinding>
<basicHttpBinding>
    <binding name="secureHttpBinding" receiveTimeout="00:01:00"
           sendTimeout="00:01:00"
           openTimeout="00:01:00"
           closeTimeout="00:05:00" maxReceivedMessageSize="2147483647">
    </binding>
  </basicHttpBinding>

服务器:

<customBinding>
    <binding name="reliableSessionOverHttps" receiveTimeout="00:01:00"
           sendTimeout="00:01:00"
           openTimeout="00:01:00"
           closeTimeout="00:05:00">
      <reliableSession />
      <httpsTransport maxReceivedMessageSize="2147483647"/>
    </binding>
  </customBinding>
<basicHttpBinding>
    <binding name="basicHttpBindNoCert" receiveTimeout="00:02:00" sendTimeout="00:02:00" openTimeout="00:02:00" closeTimeout="00:02:00"  
       maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" maxBufferSize="2147483647"  allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"  transferMode="Buffered" useDefaultWebProxy="true">
    </binding>
  </basicHttpBinding>
<basicHttpBinding>
    <binding name="secureHttpBinding" receiveTimeout="00:01:00"
           sendTimeout="00:01:00"
           openTimeout="00:01:00"
           closeTimeout="00:05:00" maxReceivedMessageSize="2147483647">
    </binding>
  </basicHttpBinding>

我得到了这个配置上的错误


知道为什么吗?如何解决呢?(我知道我可以用更小的体积发送)

您还必须增加maxBufferSize服务器端。它必须与maxReceivedMessageSize相同。你也应该把你的尺寸缩小到一个更合理的尺寸。2GB的规模太大,只会使用资源或使您容易受到攻击。使用2MB:2097152。

谢谢,但您没有回答我的问题,为什么在自定义绑定上它可以工作,而在Basichtp上它失败了。这是相同的服务器配置。