0

我有一个 WCF 服务,需要使用使用 SSL 的 basicHttpBinding 进行托管。因此,我的团队安装了启用匿名身份验证的 SSL 证书,并在 IIS 中提供了硬编码的用户名和密码。我试着给这个绑定

 <binding name="SecurityByTransport">
               <security mode="Transport">
                 <transport clientCredentialType="Windows" />
                </security>
            </binding>   

但它仍然不起作用。我收到此错误“找不到与绑定 BasicHttpBinding 的端点的方案 http 匹配的基地址。注册的基地址方案是 [https]。”

服务模型部分:

 <system.serviceModel>
<diagnostics>
  <messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtTransportLevel="true" />
</diagnostics>
<bindings>
  <customBinding>
    <binding name="netTcp">
      <binaryMessageEncoding>
        <readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" maxDepth="64" />
      </binaryMessageEncoding>
      <security authenticationMode="UserNameOverTransport" />
      <windowsStreamSecurity />
      <tcpTransport portSharingEnabled="true" maxBufferPoolSize="52428800" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
    </binding>
  </customBinding>

  <basicHttpBinding>
    <binding name="Https">
      <security mode="Transport">

      </security>
    </binding>
  </basicHttpBinding>

</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name ="Https">

      <serviceMetadata httpsGetEnabled="true"/>

      <serviceDebug includeExceptionDetailInFaults="false"/>
      <serviceCredentials>
        <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Asi.Soa.ServiceModelEx.NullUserNamePasswordValidator, Asi.Soa.ServiceModelEx" />
        <clientCertificate>
          <authentication certificateValidationMode="None" />
        </clientCertificate>
      </serviceCredentials>
      <serviceAuthorization principalPermissionMode="Custom">
        <authorizationPolicies>
          <add policyType="Asi.Soa.ServiceModelEx.ClaimsAuthorizationPolicy, Asi.Soa.ServiceModelEx" />
        </authorizationPolicies>
      </serviceAuthorization>
      <exceptionShielding/>
    </behavior>


  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="SoapBehavior">

    </behavior>
    <behavior name="RestBehavior">

    </behavior>
    <behavior name="AjaxBehavior">
      <enableWebScript />
    </behavior>
  </endpointBehaviors>
</behaviors>
<services>


  <service name="Asi.Soa.Core.Services.EntityService" >
    <endpoint address="https://10.42.150.122/imis15/EntityService.svc" binding="basicHttpBinding" contract="Asi.Soa.Core.ServiceContracts.IEntityService"
       bindingConfiguration="Https" />
  </service>

</services>

任何帮助,将不胜感激。

谢谢

4

3 回答 3

1

尝试添加到服务行为设置

      <serviceMetadata httpsGetEnabled="true"/>

您还应该检查端点是否有设置

      bindingConfiguration="SecurityByTransport"
于 2012-06-27T09:00:01.167 回答
0

如果您在 IIS 中托管您的服务,请尝试从站点绑定中删除 http 绑定。

高温高压

于 2012-06-27T12:36:27.007 回答
0

由于您在 IIS 上使用 Web 服务,因此考虑到您使用的是 SSL 证书,请使用 HTTPS 绑定。

于 2012-06-27T16:52:03.357 回答