2009-08-12 58 views
1

迎接。我意识到这可能被视为this的重复问题,但我收到了一个不同的错误。可以通过SSL(使用https)将传输安全性设置为无的WCF绑定?

我的IIS设置为使用SSL。 我的服务设置相对简单。只需一个简单的登录服务。

当我尝试直接导航到主机我得到这个错误

服务不能被激活的SVC文件,因为编译过程中的异常。异常消息是:此服务的安全设置需要Windows身份验证,但未启用承载此服务的IIS应用程序。

我不想在访问此特定服务时进行任何身份验证。我应该不能使用HTTPS绑定传输消息信用和客户端身份验证设置为无?

我有一个证书设置符合SSL,似乎很好。这就是现在这种认证方式。

<system.serviceModel> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="DefaultBehaviour"> 
     <serviceMetadata httpsGetEnabled="true" /> 
     <serviceCredentials> 
     <serviceCertificate findValue="xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx" 
      storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint" /> 
     </serviceCredentials> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<bindings> 
    <wsHttpBinding> 
    <binding name="wsBinding"> 
     <security mode="Transport"> 
     <message clientCredentialType="None" /> 
     </security> 
    </binding> 
    </wsHttpBinding> 
    <mexHttpsBinding> 
    <binding name="mex" /> 
    </mexHttpsBinding> 
</bindings> 
<services> 
    <service behaviorConfiguration="DefaultBehaviour" name="Web.Login.LoginService"> 
    <endpoint name="wsBinding" 
       address="https://staging.system.com/System/LoginService/LoginService.svc" 
       binding="wsHttpBinding" bindingConfiguration="wsBinding" 
       contract="Web.Login.IOLELoginService" /> 
    <endpoint address="mex" binding="mexHttpsBinding" bindingConfiguration="mex" name="mex" contract="IMetadataExchange" /> 
    </service> 
</services> 

回答

3

你应该能够有一个 - 只有你没有配置它的方式!

<security mode="Transport"> 
    <message clientCredentialType="None" /> 
    </security> 

如果你有交通运输安全,您需要设置clientCredentialType<transport>子元素!

试试这个:

<security mode="Transport"> 
    <transport clientCredentialType="None" /> 
    </security> 

这应该有希望的工作(没有安装,现在对其进行测试)

马克

+0

甜。当然。谢谢。这似乎是。当我现在导航到svc文件时,我没有收到任何错误,但页面只是空白。 – topwik 2009-08-12 21:07:46

+0

好的完美。我的配置一定还是搞砸了,但是。现在看起来不错。非常感谢! – topwik 2009-08-12 21:22:49