WCF绑定两个端点时出错

时间:2014-08-25 09:38:01

标签: wcf wcf-binding

我得到了这个       - 错误:未处理的类型异常        ' System.Configuration.ConfigurationErrorsException'发生在        System.Configuration.dll其他信息:绑定在        system.serviceModel / bindings / basicHttpBinding没有        配置绑定名为' BasicHttpBinding_IService1'。这是个        bindingConfiguration的值无效。

这是我的web.config文件

<?xml version="1.0"?>
<configuration>

  <configSections>
  </configSections>
  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  </appSettings>
  <system.web>
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5"/>
  </system.web>
  <system.serviceModel>

    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IService1" maxBufferSize="1000000000" maxBufferPoolSize="1000000000" maxReceivedMessageSize="100000000">
          <readerQuotas maxDepth="32" maxStringContentLength="2097152 "
            maxArrayLength="2097152" maxBytesPerRead="4096" maxNameTableCharCount="16384"  />
        </binding>
      </basicHttpBinding>
    </bindings>
    <services>
      <service name="WcfService1.Service1">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration=""
          contract="WcfService1.IService1" />
        <endpoint address="web" behaviorConfiguration="WebBehaviour" binding="webHttpBinding"
          bindingConfiguration="" name="WebEndPoint" contract="WcfService1.IService1" />
      </service>
    </services>
    <behaviors>

      <endpointBehaviors>
        <behavior name="WebBehaviour" >

          <enableWebScript />
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="DefaultBehaviour">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <protocolMapping>
        <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>    

    <serviceHostingEnvironment minFreeMemoryPercentageToActivateService="0" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
      -->
    <directoryBrowse enabled="true"/>
  </system.webServer>

</configuration>

0 个答案:

没有答案