Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.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 maxReceivedMessageSize不工作_C#_Wcf - Fatal编程技术网

C# WCF maxReceivedMessageSize不工作

C# WCF maxReceivedMessageSize不工作,c#,wcf,C#,Wcf,我有一个具有这些配置设置的WCF服务。当我从客户端应用程序调用它时,我仍然会遇到一个可怕的问题,“在对象图中可以序列化或反序列化的最大项数是‘65536’”,下面的配置有什么问题 <system.serviceModel> <bindings> <wsHttpBinding> <binding name="LargeBuffer" maxReceivedMessageSize="2147483647" maxBufferPoolSize

我有一个具有这些配置设置的WCF服务。当我从客户端应用程序调用它时,我仍然会遇到一个可怕的问题,“在对象图中可以序列化或反序列化的最大项数是‘65536’”,下面的配置有什么问题

<system.serviceModel>
  <bindings>
   <wsHttpBinding>
    <binding name="LargeBuffer" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647">
     <readerQuotas maxDepth="2147483647" maxArrayLength="2147483647" maxStringContentLength="2147483647" 
          maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
    </binding>
   </wsHttpBinding>
  </bindings>
  <services>
   <service behaviorConfiguration="ServiceBehavior" name="TestWcfService.Service1">
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="LargeBuffer" name="ServiceEndPoint"
      contract="TestWcfService.IService1">
      <identity>
       <dns value="localhost" />
      </identity>
    </endpoint>
   </service>
  </services>
  <behaviors>
   <serviceBehaviors>
    <behavior name="ServiceBehavior">
     <serviceMetadata httpGetEnabled="true" />
     <dataContractSerializer maxItemsInObjectGraph="2147483647" />
     <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
   </serviceBehaviors>
  </behaviors>
 </system.serviceModel>


是的,我在客户端增加了它以匹配。但它仍然达到了这个极限。我担心的是,当它收回服务引用时,它仍然将65536视为默认大小,因此它永远不会识别出较大的数量。有什么想法吗

以下是我的客户端代码:

<system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="ServiceEndPoint" closeTimeout="00:01:00" openTimeout="00:01:00"
                    receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
                    transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                    allowCookies="false">
                    <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"
                        maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="Message">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"
                            realm=""/>
                        <message clientCredentialType="Windows" negotiateServiceCredential="true"
                            algorithmSuite="Default" establishSecurityContext="true" />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:61423/Service1.svc" binding="wsHttpBinding"
                bindingConfiguration="ServiceEndPoint" contract="LucasImport.IService1"
                name="ServiceEndPoint">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>
        </client>
    </system.serviceModel>


在发送(序列化)和接收(反序列化)端,是否已将maxItemsInObjectGraph配额增加到超过其默认值?它在读写数据时都适用。同样的配置是否也适用于您的客户端??你只显示服务器端配置-双方都需要有新的设置才能工作。那么我基本上必须复制配置文件之间的所有内容吗,迈尔斯?