I have been plagued by an issue for the past couple of days and I am yet to find a solution. I have an service installed at several customer sites. This service grabs data from a database, packages it up and then submits it to a web service hosted on a different server. This is done using SOAP and everything works absolutely fine when I am running the submission service under .NET 2.

However, after a recent upgrade to .NET 4, I have been receiving a SoapException when my submission service attempts to logon to the web service. The error I get is: "SoapException: Unexpected error occurred when attempting to authenticate user with the LDAP repository".

The credentials have remained unchanged and I have confirmed that they are not the cause. The strange thing is, the latest version of the submission service works at some customer sites but not at others. The environments on which the service is installed vary greatly so it seems unlikely to be a platform specific issue.

I've got to the point where I am pretty much guessing at things that might be causing this problem e.g. have there been any subtle changes in the way the .NET framework handles SOAP requests between .NET 2 and .NET 4.

I haven't really supplied a whole lot of information but since I am not really too sure what people would want to know about this issue, it is probably easier if you just ask me lots of questions.

There may be a difference in how .NET is authenticating with the LDAP server. Are you using a web config (MembershipProviders) to authenticate, or are you hard coding the credential check on the server?

Possible causes are:

  • Credentials to the LDAP Admin account have changed (I believe the newer windows server use Username@Domain instead of Domain\Username)
  • The LDAP server adddress is incorrect
  • There is an error in the memebership provider (public key? version?)
  • The membership provider is incompatiable with you LDAP server (again, version)
  • The account accessing LDAP (possibly impersonation) does not have rights

These are some of the problems I have run into when authentication is failing. The error is very generic, and could mean anything from the server not being found to not having rights to read.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.