Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/328.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.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# maxReceivedMessageSize WCF_C#_Wcf_Maxreceivedmessagesize - Fatal编程技术网

C# maxReceivedMessageSize WCF

C# maxReceivedMessageSize WCF,c#,wcf,maxreceivedmessagesize,C#,Wcf,Maxreceivedmessagesize,我使用WCF服务,但我有一个问题 传入邮件的最大邮件大小配额(65536)已被取消 超过。要增加配额,请使用MaxReceivedMessageSize 属性,该属性位于相应的绑定元素上 我修改了MaxReceivedMessageSize,但没有结果(我在互联网上读了很多文章,但任何人都帮不上忙) 谁知道这件事 Service.config: <system.serviceModel> <bindings> <

我使用WCF服务,但我有一个问题

传入邮件的最大邮件大小配额(65536)已被取消 超过。要增加配额,请使用MaxReceivedMessageSize 属性,该属性位于相应的绑定元素上

我修改了
MaxReceivedMessageSize
,但没有结果(我在互联网上读了很多文章,但任何人都帮不上忙)

谁知道这件事

Service.config:

<system.serviceModel>       
   <bindings>           
      <wsHttpBinding>
         <binding name="BindingWithMaxSizeIncreased" 
                  maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
            <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
                          maxArrayLength="2147483647" maxBytesPerRead="2147483647" 
                          maxNameTableCharCount="2147483647" />
         </binding>             
      </wsHttpBinding>      
   </bindings>      
   <services>           
      <service name="FootballLife.MyService" behaviorConfiguration="metadataBehavior">
         <endpoint 
             address="" 
             binding="wsHttpBinding" bindingConfiguration="BindingWithMaxSizeIncreased" 
             contract="FootballLife.IMyService">
            <identity>
               <dns value="localhost"/>
            </identity>
         </endpoint>
         <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>        
   </services>      
   <behaviors>          
      <serviceBehaviors>
         <behavior name="metadataBehavior">
            <serviceMetadata httpGetEnabled="true"/>
            <serviceDebug includeExceptionDetailInFaults="false"/>
         </behavior>            
      </serviceBehaviors>       
   </behaviors>         
   <serviceHostingEnvironment aspNetCompatibilityEnabled="true" 
                              multipleSiteBindingsEnabled="true" />   
</system.serviceModel>

Client.config

<system.serviceModel>
   <bindings>
      <wsHttpBinding>
          <binding name="BindingWithMaxSizeIncreased"
                   maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
              <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
                            maxArrayLength="2147483647" maxBytesPerRead="2147483647" 
                            maxNameTableCharCount="2147483647" />
          </binding>
      </wsHttpBinding>
   </bindings>
   <client>
      <endpoint 
          address="http://localhost:90/MyService.svc" 
          binding="wsHttpBinding" 
          contract="IMyService">
         <identity>
            <dns value="localhost" />
         </identity>
      </endpoint>
   </client>
</system.serviceModel>

您需要在客户端配置中将自定义绑定配置提供给您的端点:

<endpoint address="http://localhost:90/MyService.svc" 
    binding="wsHttpBinding" 
    contract="IMyService"
    bindingConfiguration="BindingWithMaxSizeIncreased">
    <identity>
        <dns value="localhost" />
    </identity>
</endpoint>