当我尝试调用 WCF 服务时,我收到以下消息“验证消息的安全性时发生错误”。
当我删除自定义身份验证时,服务没有问题。我无法弄清楚我在 web.config 中的配置错误。任何见解将不胜感激。
<system.serviceModel>
<services>
<service behaviorConfiguration="NAThriveExtensions.nableAPIBehavior"
name="NAThriveExtensions.nableAPI">
<endpoint
address=""
binding="basicHttpBinding"
bindingConfiguration="basicHttpBinding_Secure"
contract="NAThriveExtensions.InableAPI">
</endpoint>
<endpoint
address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="NAThriveExtensions.nableAPIBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceCredentials>
<userNameAuthentication
userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType= "NAThriveExtensions.Authentication, NAThriveExtensions" />
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding_Secure">
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>