WCF http& https端点一个合同

时间:2010-04-05 03:49:30

标签: .net wcf http iis https

我已经创建了wcf服务,并希望使用http和https版本。服务由IIS 6.0托管。

在我的配置中,我有:

  <bindings>
  <basicHttpBinding>
    <binding name="BindingConfiguration1" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
      maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
      <security mode="TransportWithMessageCredential">
        <transport clientCredentialType="None"/>
        <message clientCredentialType="UserName" />
      </security>
    </binding>
  </basicHttpBinding>
</bindings> 
 <services>
  <service name="RegistratorService.Registrator" behaviorConfiguration="RegistratorService.Service1Behavior">
    <endpoint binding="basicHttpBinding"
              contract="RegistratorService.IRegistrator"
              bindingConfiguration="BindingConfiguration1">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint binding="basicHttpBinding" contract="RegistratorService.IRegistrator">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
    <host>
      <baseAddresses>
        <add baseAddress="http://aurit-server2" />
      </baseAddresses>
    </host>
  </service>
</services>

但即使在浏览器中我也有异常“提供的URI方案'http'无效;预期'https'”

怎么了? 感谢。

1 个答案:

答案 0 :(得分:0)

您是否在IIS6中为托管WCF的网站设置了SSL。如果您确实要确保没有要求SSL,如果要同时允许http和https