WCF-xml配置


      
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>

    <services>
      <!-- 注意: 服务名称必须与服务实现的配置名称相匹配。 -->
      <service name="WindowsFormsApp8.MainService" 
        behaviorConfiguration="MainServiceBehaviors">
        
        <!-- 添加下列终结点。 -->
        <!-- 注意: 服务必须有一个 http 基址以便添加此终结点。 -->
        <endpoint contract="WindowsFormsApp8.IMainService" binding="basicHttpBinding" address="" >
        </endpoint>
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8091"/>
          </baseAddresses>
        </host>
      </service>
    </services>

    <behaviors>
      <serviceBehaviors>
        <behavior name="MainServiceBehaviors" >
          <!-- 将下列元素添加到服务行为配置中。 -->
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>

    <bindings>
      <basicHttpBinding>
        <binding name="defaultBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647">
          <readerQuotas 
            maxArrayLength="2147483647" 
            maxStringContentLength="2147483647" 
            maxNameTableCharCount="2147483647"/>
        </binding>
      </basicHttpBinding>
    </bindings>
  </system.serviceModel>
</configuration>