basquang™ on clouds

August 18, 2009

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

Filed under: WCF — basquang @ 11:03 AM

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>]

clip_image002[6]

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.

clip_image003

You see: Identity: ApplicationPoolIdentity (Windows 7 IIS)

clip_image004

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

clip_image005

Hope this help!

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: