tags:

views:

3933

answers:

2

Solution to original problem (below) may have been discovered. I commented out

<identity> 
    ...
</identity>

tag in the app.config file for the client. But I'm not sure if this is going to cause other problems, if it does, could someone let me know?


I've been following the Getting Started tutorial at MSDN for WCF.

I'm using Visual Studio.net 2008 on Vista x64. The Service program is running just fine. However, the client is having issues.

When I run the client I get this exception:

SecurityNegotiationException was unhandled SOAP security negotiation with 'http://localhost:8000/ServiceModelSamples/Service/CalculatorService' for target 'http://localhost:8000/ServiceModelSamples/Service/CalculatorService' failed. See inner exception for more details.

The inner exception message says:

"The Security Support Provider Interface (SSPI) negotiation failed."

My code is pretty much exactly the same as the example's. I've never really done anything with web services or WCF or anything similar. Anyone know how I could go about fixing this? Thanks.

Edit - I forgot to mention where the exception is thrown... In the client's Main method:

CalculatorClient client = new CalculatorClient();

double value1 = 100.00;
double value2 = 15.99;
double result = client.Add(value1, value2); //This is the line that throws the error

//...

I added client.Open(); right after the client init, because I searched Google and someone was having problems too and that helped him, but when I do that the same exception is thrown on the new line.

+1  A: 

SSPI failing is a Kerberos-related security negotiation failure. Are you on a domain, and you might have trouble communicating with the domain controller right now? Or is there another reason that you'd be unable to authenticate at the moment?

rwmnau
Yeah, this laptop is on the school's domain and I'm at home. Is that what's wrong then? How would I fix this problem? (Aside from the obvious, connect to the domain, because when I'm not at school that's not an option)
Joel
Kerberos works as a ticket/time based system, where an authentication ticket is only good for a certain period of time - in some cases, a few minutes. You can downgrade your security to something like "Integrated Authentication", if that's available, or anonymous with a password, but SSPI needs a DC
rwmnau
A: 

In your service contract attributes add following lines

[ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples")]

Shiv Kumar Pal