2012-06-27 48 views
0

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

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

但它仍然无法正常工作。我得到这个错误“找不到与绑定basicHttpBinding的端点符合计划http的基址注册的基址方案是[HTTPS]。”

ServiceModel部分:

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

任何帮助,将不胜感激。

感谢

+0

你可以完全发布serviceModel部分来帮助你吗? – Rajesh

+0

使用serviceModel部分Rajesh编辑帖子。任何建议都会非常有帮助。 – Deefa

+0

你在IIS上托管你的服务? – Rajesh

回答

1

尝试添加到服务行为设置

 <serviceMetadata httpsGetEnabled="true"/> 

您也应该检查endpoind有一个设置

 bindingConfiguration="SecurityByTransport" 
+0

嗨paramosh,请你能看看serviceModel部分,net.tcp绑定的作品很好,我需要同样为basicHttpBinding的工作,使我能够使用https – Deefa

+0

<服务名称=“Asi.Soa.Core.Services.EntityService” behaviorConfiguration =“Https”> – paramosh

+0

通过添加HttpsGetEnabled = true和HttpGetEnabled = false解决了它;谢谢大家。 – Deefa

0

如果你正在主持在IIS服务,请尝试从网站绑定中删除http绑定。

HTH

0

由于您使用的是IIS Web服务,使用HTTPS它考虑到你正在使用SSL证书绑定。