WCF配置文件中的限制和配额

时间:2017-03-21 02:17:24

标签: wcf config throttling quotas

我可以使用一些帮助为我的WCF编写配置文件。一切都在努力,直到我试图包括使用限制和配额。不确定我是否正确使用标签或在正确的位置。下面是我的App.config文件:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup> 
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<appSettings>  
<add key="baseAddress" value="http://localhost:8000" />  
</appSettings> 
<system.serviceModel>
<services>
<service behaviorConfiguration="mexBehaviour" name="StringManipulationService.StringManipulation">
  <endpoint address="StringManipulationService" binding="basicHttpBinding"
    contract="StringManipulationService.IStringManipulation" />
  <endpoint address="StringManipulationService" binding="netTcpBinding"
    contract="StringManipulationService.IStringManipulation" />
   <endpoint address="" binding="wsHttpBinding"
    contract="StringManipulationService.IStringManipulation" />
  <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  <host>
    <baseAddresses>
      <add baseAddress="http://localhost:8080/" />
      <add baseAddress="net.tcp://localhost:8090/" />
    </baseAddresses>
  </host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="mexBehaviour">
  <serviceMetadata httpGetEnabled="true"/>
</behavior>
<behavior name="Throttled">
  <serviceThrottling
       maxConcurrentCalls="1"
       maxConcurrentSessions="1"
       maxConcurrentInstances="1"
      />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<bindings>
<basicHttpBinding>
  <binding name="basicHttp" allowCookies="true"
           maxReceivedMessageSize="20000000"
           maxBufferSize="20000000"
           maxBufferPoolSize="20000000">
    <readerQuotas maxDepth="32"
         maxArrayLength="200000000"
         maxStringContentLength="200000000"/>
  </binding>
</basicHttpBinding>
</bindings>
</configuration>

0 个答案:

没有答案