WCF error: SOAP security negotiation failed for target

I got this error when I tried to host the WCF service in the IIS 7.5 using WSHttpBinding.

[System.ServiceModel.Security.SecurityNegotiationException] {"SOAP security negotiation with ‘http://localhost/Migraton/MigrationService.svc’ for target ‘http://localhost/OrderService/OrderService.svc’ failed. See inner exception for more details."}

Inner Exception
[System.ComponentModel.Win32Exception] {"The Security Support Provider Interface (SSPI) negotiation failed."}


The solution was to change the following userPrincipalName in the <userPrincipalName value="MACHINENAMEASPNET" /> to <servicePrincipalName value="host/localhost" /> . This did the trick and solved the issue.

6 thoughts on “WCF error: SOAP security negotiation failed for target

  1. Thanks for your help..It worked..But why we are setting this attribute or element. What is the issue with userPrincipalName?
    if it is due to security reason, I have tried with setting the security mode of binding as None. Still same error. Please let me know the root cause of this issue if anybody

  2. Pingback: WCF error: SOAP security negotiation failed for target - My experiments with SharePoint, Azure and .NET using Visual Studio

  3. I am not hosting the WCF service on local m/c.
    Also consuming client is running on separate m/c. So I have
    in client config.
    But still I am getting the same error mentioned by lavssun above.
    Any help would be really appreciated. Thanks.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

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

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.