Thứ Ba, 18 tháng 8, 2009

WCF and ASP.NET Membership error: An error occurred when verifying security for the message

System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrect
ly secured fault was received from the other party. See the inner FaultException
for the fault code and detail. ---> System.ServiceModel.FaultException: An erro
r occurred when verifying security for the message.
   --- End of inner exception stack trace ---

 

I got this error message when deploy and use WCF with ASP.NET Membership over Internet. My WCF service use wsHttpBinding and Security mode = TransportWithMessageCredential. My machine for test are Windows 7, Visual Studio 2008 SP1, SQL Express 2005. I’ve spent more time to looking for solution. After that, It’s worked fine! Here are work around and solutions

Open Event Viewer

Following error was appeared:

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed. [CLIENT: <local machine>]

A21319952F68E79E_525_0[1]

This is the root of problem.

Solution:

Add following account to SQL Server

- IIS APPPOOL\DefaultAppPool

- Local System

- Local Services

2. Open the Application Pool of your website used.

A21319952F68E79E_525_1[1]

You see: Identity: ApplicationPoolIdentity (Windows 7 IIS)

A21319952F68E79E_525_2[1]

3. Change the Identity to one of other account then iisreset

A21319952F68E79E_525_3[1]

Hope this help!

Không có nhận xét nào:

Đăng nhận xét