コンソールアプリケーションとWindowsサービスとして実行できるWCFサービスがあります。私は最近、次のセキュリティ設定のW2K3サーバーにコンソールアプリケーションをコピーしました:WindowsサービスでのWCFセキュリティ
<wsHttpBinding>
<binding name="ServiceBinding_Security" transactionFlow="true" >
<security mode="TransportWithMessageCredential" >
<message clientCredentialType="UserName" />
</security>
</binding>
</wsHttpBinding>
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType="Common.CustomUserNameValidator, Common" />
</serviceCredentials>
セキュリティは問題なく問題なく動作します。私は正確に同じコードを持っていますが、Windowsサービスで実行されていると私は、クライアントからのいずれかの方法を呼び出すしようとすると、私は次のエラーを取得する:
System.ServiceModel.Security.MessageSecurityException was unhandled
Message="An unsecured or incorrectly secured fault was received from
the other party. See the inner FaultException for the fault code and detail."
Source="mscorlib"
StackTrace:
Server stack trace:
at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout)
......
(lots of stacktrace info - not very useful)
InnerException: System.ServiceModel.FaultException
Message="An error occurred when verifying security for the message."
例外は私に何も伝えていません。私はそれがWindowsサービスからのシステムリソースへのアクセスと関係があると仮定しています。私はコンソールアプリケーションと同じアカウントで実行しようとしましたが、運はありません。誰にもアイデアはありますか?
これは私に痛い頭を与えました... – James
セキュリティ情報は次のとおりです。 <バインディング名= "ServiceBinding_Security" transactionFlow = "真"> <セキュリティモード= "TransportWithMessageCredential"> \t <メッセージclientCredentialType = "ユーザー名" /> \t \t \t \t \t \t \t wsHttpBinding> serviceCredentials> –
Alphonso