WCF 'A Call to SSPI Failed, see inner exception'

29,125

Solution 1

Thanks tomasr, it was a misconfigured SPN.

Too bad there's no functionality on this site to close your own question, I'll have to wait 2 days to choose this one :-)

Thanks again!

Solution 2

i removed identity element from config for local testing when i was not connected to domain. It works.

reference -

http://blogs.msdn.com/b/jpsanders/archive/2010/10/14/wcf-client-inner-exception-quot-the-security-support-provider-interface-sspi-negotiation-failed-quot.aspx

Solution 3

under the <system.serviceModel>
<bindings>
    <netTcpBinding>
        <binding name="netTcp">
            <security mode="None">
        </binding>
    </netTcpBinding>
</bindings>

add this to bindingConfiguration in the endpoint

ref: https://www.youtube.com/watch?v=KYDBjoCYAC4&list=PL6n9fhu94yhVxEyaRMaMN_-qnDdNVGsL1&index=53

Share:
29,125
Joel Coehoorn
Author by

Joel Coehoorn

2009-2013 Microsoft ASP.Net MVP It's pronounced: koo-horn. The avatar is both because I play counter strike and a nod to lambda expressions in C#. Twitter: @jcoehoorn

Updated on February 03, 2020

Comments

  • Joel Coehoorn
    Joel Coehoorn over 4 years

    I had a self-hosted win service WCF installed and running at one point.

    Naturally, I had to make some changes. So I changed the base address back to my local workstation and made the changes. It worked fine.

    Now it's time to redistribute and... Well... It keeps hosing and I can't figure it out.

    From the app.config file:

    <system.serviceModel>
    <services>
      <service behaviorConfiguration="ExStreamWCF.Service1Behavior"
        name="ExStreamWCF.Service1">
        <endpoint address="" binding="netTcpBinding" bindingConfiguration=""
          contract="ExStreamWCF.IService1">
          <identity>
            <dns value="Devexstream-2" />
            <!--<dns value="vmwin2k3sta-tn2" />-->
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
          contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://Devexstream-2:8080/Service" />
            <!--<add baseAddress="net.tcp://vmwin2k3sta-tn2:8080/Service" />-->
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ExStreamWCF.Service1Behavior">
          <serviceMetadata httpGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    

    From the web.config file (long story):

      <system.serviceModel>
        <services>
      <service behaviorConfiguration="ExStreamWCF.Service1Behavior"
        name="ExStreamWCF.Service1">
        <endpoint address="" binding="netTcpBinding" bindingConfiguration=""
          contract="ExStreamWCF.IService1">
          <identity>
            <dns value="Devexstream-2" />
            <!--<dns value="vmwin2k3sta-tn2" />-->
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
          contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://Devexstream-2:8080/Service" />
            <!--<add baseAddress="net.tcp://vmwin2k3sta-tn2:8080/Service" />-->
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ExStreamWCF.Service1Behavior">
          <serviceMetadata httpGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    

    Any guesses on what I'm doing wrong?

    • Forgotten Semicolon
      Forgotten Semicolon almost 13 years
      What does the inner exception say?
    • Admin
      Admin almost 13 years
      I honestly don't know how to find out what the inner exception says!
    • tomasr
      tomasr almost 13 years
      Enabled WCF tracing on the service (msdn.microsoft.com/en-us/library/ms733025.aspx), it will likely give you all the necessary information. If you're on a domain, I'd assume it's something causing kerberos to fail (like a missing or misconfigured SPN, or the base address using a hostname that doesn't match the SPN configured or is not known to the domain controllers).
  • Jamal Ashraf
    Jamal Ashraf over 12 years
    in my case it was caused by the endpoint using a server address in upper case, changing to lower case resolved this immediately
  • THEIVA Uthayathas
    THEIVA Uthayathas over 5 years
    add this to bindingConfiguration in the endpoint <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="netTcp" contract="IMetadataExchange" />
  • Muhammad Dyas Yaskur
    Muhammad Dyas Yaskur over 4 years
    I think your post looks like a comment rather than an answer.