我去过几个网站,关于如何纠正这个错误并且无法摆脱错误。我在启用了SSL的IIS 6上托管它。以下是我的配置
<services>
<service behaviorConfiguration="UsernamePasswordBehavior" name="DataServices.BEService">
<endpoint address="mex" binding="mexHttpsBinding" name="mex" contract="IMetadataExchange" listenUri="https://mysite/beservice.svc"/>
<endpoint address="wsbe" binding="wsHttpBinding" bindingConfiguration="wsHttpWithUsernamePassword"
name="BEwsHttp" contract="DataServices.IBEService" listenUri="https://mysite/beservice.svc" />
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="wsHttpWithUsernamePassword" sendTimeout="00:06:00" receiveTimeout="00:06:00">
<security mode="Message">
<message clientCredentialType="UserName"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="UsernamePasswordBehavior">
<serviceMetadata httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="DataServices.CustomUsernameValidator, DataServices" />
<serviceCertificate findValue="*.mysite.com" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
希望有人可以提供帮助!
答案 0 :(得分:0)
听起来您正在托管的IIS网站实例仅配置为HTTPS(SSL)。右键单击网站实例,然后选择“编辑绑定...”。你看到那里列出了端口80(普通HTTP)吗?同时检查“SSL设置”功能,确保未启用“始终需要”选项。 - 取自堆栈溢出本身。它可以工作,因为您在配置中仅使用消息安全性,必须有绑定到站点的非HTTPS / SSL地址。 在本地计算机上使用自签名证书时,您的代码是否有效?
答案 1 :(得分:0)
我认为你需要使用
<security mode="TransportWithMessageCredential">
对于您的安全模式,而不是消息?