首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WCF中的Https绑定引发错误

WCF中的Https绑定引发错误
EN

Stack Overflow用户
提问于 2012-06-27 16:22:45
回答 3查看 605关注 0票数 0

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

代码语言:javascript
复制
 <binding name="SecurityByTransport">
               <security mode="Transport">
                 <transport clientCredentialType="Windows" />
                </security>
            </binding>   

但是它仍然不能工作。我收到这样的错误:“找不到与绑定了BasicHttpBinding的端点的方案http匹配的基地址。注册的基地址方案是https。”

ServiceModel部分:

代码语言:javascript
复制
 <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>

任何帮助都将不胜感激。

谢谢

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2012-06-27 17:00:01

尝试添加到服务行为设置

代码语言:javascript
复制
      <serviceMetadata httpsGetEnabled="true"/>

此外,您还应该检查endpoind是否有设置

代码语言:javascript
复制
      bindingConfiguration="SecurityByTransport"
票数 1
EN

Stack Overflow用户

发布于 2012-06-27 20:36:27

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

HTH

票数 0
EN

Stack Overflow用户

发布于 2012-06-28 00:52:03

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11222101

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档