繁体   English   中英

WCF http和https端点一个合同

[英]WCF http & https endpoint one contract

我已经创建了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'”

怎么了? 谢谢。

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

暂无
暂无

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

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