简体   繁体   English

WCF http和https端点一个合同

[英]WCF http & https endpoint one contract

I've created wcf service and want use http and https version. 我已经创建了wcf服务,并希望使用http和https版本。 Service is hosted by IIS 6.0. 服务由IIS 6.0托管。

At my config I have: 在我的配置中,我有:

  <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>

But even at browser I've got exception "The provided URI scheme 'http' is invalid; expected 'https'" 但是,即使在浏览器中,我也遇到异常“提供的URI方案'http'是无效的;预期为'https'”

What's wrong? 怎么了? Thanks. 谢谢。

do you have SSL set up in IIS6 for the website hosting WCF. 在IIS6中为托管WCF的网站设置了SSL。 If you do make sure you don't have SSL required checked if you want to allow both http and https 如果确实要同时允许http和https,请确保没有选中SSL要求

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM