私は顧客のユーザー名/パスワードバリデーターを持っています。 web.configのendpoints bindingConfiguration属性にそれを入れるだけで十分ですか、それともServiceメソッドで明示的に呼び出す必要がありますか?私はそれをサービスオペレーションと呼んでいないときに呼び出されることに気付きました。私は何か間違っているのですか?web.configエンドポイントBindingConfigurationにカスタムユーザー名バリデーターを置くだけで十分ですか?
これは私が私のバインディングを持っているかのセクションに定義されています。これは私が私のサービスノードが定義されている方法です
<bindings>
<wsHttpBinding>
<binding name="CustomAuthentication">
<security mode="Message">
<message clientCredentialType="UserName"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
:
<service behaviorConfiguration="CustomValidator" name="Test.TestService">
私のエンドポイント属性は、そのBindingConfiguration = "CustomAuthentication"
を持っていますこれは、私のServiceBehaviorsの動作を定義したものです:
<behavior name="CustomValidator">
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType="Test.CustomUserNameValidator, FuzionSync"/>
<serviceCertificate findValue="MyWebSite" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName"/>
</serviceCredentials>
<serviceMetadata httpGetEnabled="True"/>
</behavior>
サービスコールを呼び出すためにwcfテストクライアントを実行すると、Validateメソッドも呼び出されません。私がそれを呼び出すための唯一の方法は、明示的に呼び出す操作にそれを置く場合です。
私が正しいとすれば、wcfサービスに接続する前に、これらを信用証明書として使用する必要があります。 – BreakHead
@BreakHead、私はあなたの答えに混乱していますか? – Xaisoft